Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.