WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] child of post type (custom) (2 posts)

  1. timduncan
    Member
    Posted 1 year ago #

    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?

    thanks!

  2. timduncan
    Member
    Posted 1 year ago #

    solved:

    $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;

Topic Closed

This topic has been closed to new replies.

About this Topic