Permalink
Browse files

Make loop.php content aware

Most template parts now support advanced replacement of loop.php - just like other tempalte parts in Wonderflux.

This is only really for advanced edge cases - the standard loop.php in Wonderflux will do in 99% of use cases… but this allows you to do really cool things like extending WP_Query and using files like loop-archive-yourcustomposttype.php to do fancy things with your loop otherwise not possible.

TIP: Just to re-iterate, 99% of cases just need loop-content.php in your child theme, see documentation in readme. You can create files like loop-content-archive-posttype.php which will give you full control of ‘inside’ the loop - this update relates to the whole WordPress ’loop’.

TIP: Ensure you start by duplicating loop.php so you retain all Wonderflux hooks, otherwise it will be stormy waters!
  • Loading branch information...
Jonnyauk committed Dec 4, 2017
1 parent 7780fb6 commit 91e24d5f501619cc7dcb704fd930cc46cc395e2f
Showing with 13 additions and 13 deletions.
  1. +1 −1 archive.php
  2. +1 −1 attachment.php
  3. +1 −1 author.php
  4. +1 −1 buddypress/buddypress.php
  5. +1 −1 category.php
  6. +1 −1 date.php
  7. +1 −1 home.php
  8. +1 −1 index.php
  9. +1 −1 page.php
  10. +1 −1 search.php
  11. +1 −1 single.php
  12. +1 −1 tag.php
  13. +1 −1 taxonomy.php
View
@@ -24,7 +24,7 @@
wfmain_before_all_content(); //WF display hook
wfmain_before_archive_content(); //WF display hook
get_template_part( 'loop', 'archive' );
wfx_get_template_part( 'part=loop' ); // Setup all location aware template parts
wfmain_after_archive_content(); //WF display hook
wfmain_after_all_content(); //WF display hook
View
@@ -24,7 +24,7 @@
wfmain_before_all_content(); //WF display hook
wfmain_before_attachment_content(); //WF display hook
get_template_part( 'loop', 'attachment' );
wfx_get_template_part( 'part=loop' ); // Setup all location aware template parts
wfmain_after_attachment_content(); //WF display hook
wfmain_after_all_content(); //WF display hook
View
@@ -24,7 +24,7 @@
wfmain_before_all_content(); //WF display hook
wfmain_before_author_content(); //WF display hook
get_template_part( 'loop', 'author' );
wfx_get_template_part( 'part=loop' ); // Setup all location aware template parts
wfmain_after_author_content(); //WF display hook
wfmain_after_all_content(); //WF display hook
@@ -37,7 +37,7 @@
wfmain_before_all_content(); //WF display hook
wfmain_before_bp_content(); //WF display hook
get_template_part( 'loop', 'wonderflux' );
wfx_get_template_part( 'part=loop' ); // Setup all location aware template parts
wfmain_after_bp_content(); //WF display hook
wfmain_after_all_content(); //WF display hook
View
@@ -24,7 +24,7 @@
wfmain_before_all_content(); //WF display hook
wfmain_before_category_content(); //WF display hook
get_template_part( 'loop', 'category' );
wfx_get_template_part( 'part=loop' ); // Setup all location aware template parts
wfmain_after_category_content(); //WF display hook
wfmain_after_all_content(); //WF display hook
View
@@ -24,7 +24,7 @@
wfmain_before_all_content(); //WF display hook
wfmain_before_date_content(); //WF display hook
get_template_part( 'loop', 'date' );
wfx_get_template_part( 'part=loop' ); // Setup all location aware template parts
wfmain_after_date_content(); //WF display hook
wfmain_after_all_content(); //WF display hook
View
@@ -24,7 +24,7 @@
wfmain_before_all_content(); //WF display hook
wfmain_before_home_content(); //WF display hook
get_template_part( 'loop', 'home' );
wfx_get_template_part( 'part=loop' ); // Setup all location aware template parts
wfmain_after_home_content(); //WF display hook
wfmain_after_all_content(); //WF display hook
View
@@ -24,7 +24,7 @@
wfmain_before_all_content(); //WF display hook
wfmain_before_index_content(); //WF display hook
get_template_part( 'loop', 'index' );
wfx_get_template_part( 'part=loop' ); // Setup all location aware template parts
wfmain_after_index_content(); //WF display hook
wfmain_after_all_content(); //WF display hook
View
@@ -29,7 +29,7 @@
else: wfmain_before_page_content(); //WF display hook
endif;
get_template_part( 'loop', 'page' );
wfx_get_template_part( 'part=loop' ); // Setup all location aware template parts
if (is_home() || is_front_page()) : wfmain_after_home_content(); //WF display hook
else: wfmain_after_page_content(); //WF display hook
View
@@ -24,7 +24,7 @@
wfmain_before_all_content(); //WF display hook
wfmain_before_search_content(); //WF display hook
get_template_part( 'loop', 'search' );
wfx_get_template_part( 'part=loop' ); // Setup all location aware template parts
wfmain_after_search_content(); //WF display hook
wfmain_after_all_content(); //WF display hook
View
@@ -25,7 +25,7 @@
wfmain_before_all_content(); //WF display hook
wfmain_before_single_content(); //WF display hook
get_template_part( 'loop', 'single' );
wfx_get_template_part( 'part=loop' ); // Setup all location aware template parts
wfmain_after_single_content(); //WF display hook
wfmain_after_all_content(); //WF display hook
View
@@ -24,7 +24,7 @@
wfmain_before_all_content(); //WF display hook
wfmain_before_tag_content(); //WF display hook
get_template_part( 'loop', 'tag' );
wfx_get_template_part( 'part=loop' ); // Setup all location aware template parts
wfmain_after_tag_content(); //WF display hook
wfmain_after_all_content(); //WF display hook
View
@@ -24,7 +24,7 @@
wfmain_before_all_content(); //WF display hook
wfmain_before_taxonomy_content(); //WF display hook
get_template_part( 'loop', 'taxonomy' );
wfx_get_template_part( 'part=loop' ); // Setup all location aware template parts
wfmain_after_taxonomy_content(); //WF display hook
wfmain_after_all_content(); //WF display hook

1 comment on commit 91e24d5

@Jonnyauk

This comment has been minimized.

Show comment
Hide comment
@Jonnyauk

Jonnyauk Dec 4, 2017

Owner

This needs documentation, see issue #72

Owner

Jonnyauk commented on 91e24d5 Dec 4, 2017

This needs documentation, see issue #72

Please sign in to comment.