Created
December 24, 2013 14:28
-
-
Save billerickson/8114100 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); // Remove default loop | |
add_action( 'genesis_loop', 'AMS_custom_multiloop' ); // Execute custom child loop | |
function AMS_custom_multiloop() { | |
// this variable should capture cust. taxonomy meta | |
$fake_pieces = array( | |
array("title"=>"Parent 1", "slug"=>"parent-category-i"), | |
array("title"=>"Grandchild 1", "slug"=>"grandchild-category-i") | |
); | |
$fake_length = count($fake_pieces); | |
for ($i = 0; $i $fake_pieces[$i]['slug'], // drop art-pieces META in here | |
'posts_per_page' => '-1', | |
); | |
$piece_entries = new WP_Query( $args ); | |
if( $piece_entries->have_posts() ): | |
// drop some META in here too | |
echo ''. $fake_pieces[$i]['title'] . ''; | |
while ( $piece_entries->have_posts() ) : $piece_entries->the_post(); | |
// Here's where the magic happens! | |
echo '<a href="' . get_permalink() . '" rel="nofollow">' . get_the_title() . '</a>'; | |
endwhile; | |
echo ''; | |
endif; | |
wp_reset_postdata(); | |
} // end for loop | |
} // end multiloop fcn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment