Skip to main content
1 of 2
meekbot
  • 161
  • 2

It would probably be better to do a check first with the function, then generate the list using the current post id.

// Post ID not the same so it has children    
<?php if ($post->ID != get_post_top_ancestor_id()) { ?>
   <?php wp_list_pages( array('title_li'=>'','include'=>$post->ID) ); ?>
   <?php wp_list_pages( array('title_li'=>'','depth'=>1,'child_of'=>$post->ID) ); ?>
<?php } ?>
meekbot
  • 161
  • 2