child of post type (custom)

I registered a custom post type (foo) with register_post_type, setting 'hierarchical' => true,so now when I want to use it I have post_type=foo.

How can I query child of foo? any ideas?

Read More

thanks!

Related posts

Leave a Reply

1 comment

  1. You can display child pages of particular parent foo page using following code ( using parent page ID ):

    $the_query = new WP_Query( 'post_type=foo&post_parent=93' );
    
    // The Loop
    while ( $the_query->have_posts() ) :
    $the_query->the_post();
    echo '<li>' . get_the_title() . '</li>';
    endwhile;