Support » Themes and Templates » List Child pages only NOT parent pages

  • I’m currently using this snippet:

    from the codex page

    <?php if ( $post->post_parent ) : ?>
    <ul>
    <?php $children = wp_list_pages ( "title_li=&child_of=".$post->post_parent."&echo=0" ); ?>
    <?php else : ?>
    <?php $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0&depth=2" ); ?>
    </ul>
    <?php endif?>
    <?php if ($children) { ?>
    <?php echo $children; ?>
    <?php } else { ?>
    <?php } ?>

    However it outputs parent pages as well. I just wanted the children from that particular parent? Any ideas or places where to look? I’ve searched vigorously as well.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘List Child pages only NOT parent pages’ is closed to new replies.