I've spent a LONG time trying to get nested custom post types working. Here's the setup. I have two custom post types, topics and replies. I'm looping through topics and inside the topic loop I'm placing the reply loop. So far so good. Topics and replies display fine. But I want to nest the replies in a hierarchical fashion. Lots of reading tells me I probably need a custom post type walker. I've been trying to make such a walker but not successfully. Most walkers are for navs or for pages, not custom posts. Or perhaps to use a recursive function?
Here are the current working reply args:
$args = array(
'post_type' => 'reply', // custom post type
'orderby' => 'menu_order',
'order' => 'ASC',
'post_parent' => $topic_id, //the topic
);
$loopReply = new WP_Query( $args );
//////// REPLY LOOP /////////////////////////////////////////////////////////
while( $loopReply->have_posts() ): $loopReply->the_post(); global $post;