Support » Fixing WordPress » display child but not subchild with get_pages

  • this is what I got but I can’t make grandchild to not show.
    there is no depth option for get_pages. I used get_pages because it have the number option.

    this is the code i’m using. I would like to show child but not grandchild.

    thanks

    <?php
    $subpages = get_pages('depth=0&sort_order=desc&child_of=1119&sort_column=post_date&number=5');
    
    		foreach($subpages as $page) {
    	echo "<li><a href=\"".get_page_link($page->ID)."\">$page->post_title</a></li>";
    		}
    	echo "</li>";
    
    ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘display child but not subchild with get_pages’ is closed to new replies.