Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created December 24, 2013 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/8114100 to your computer and use it in GitHub Desktop.
Save billerickson/8114100 to your computer and use it in GitHub Desktop.
<?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"=&gt;"Parent 1", "slug"=&gt;"parent-category-i"),
array("title"=&gt;"Grandchild 1", "slug"=&gt;"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' =&gt; '-1',
);
$piece_entries = new WP_Query( $args );
if( $piece_entries-&gt;have_posts() ):
// drop some META in here too
echo ''. $fake_pieces[$i]['title'] . '';
while ( $piece_entries-&gt;have_posts() ) : $piece_entries-&gt;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