Forums

"child_of" with "post_type" wont work (1 post)

  1. LeeMiller
    Member
    Posted 1 year ago #

    Hi guys. i have a problem:

    Pages in my site have hierarchy like
    page 1
    page 2
    page 2.1
    page 2.2
    page 2.3
    page 2.4
    page 2.4.1
    page 2.4.2
    page 2.5
    page 2.6
    page 3

    i need query only all child pages of 2.1 (ID=5) and 2.4 (ID=6)

    <?php
    $args = array('post_type' => 'page','child_of' => array('5,6'));
    query_posts($args);
    while (have_posts()) : the_post();
    ?>

    but i get all pages and its child. Wich query can retrieve all child pages of ID=5 and ID=6

Topic Closed

This topic has been closed to new replies.

About this Topic