$children = wp_list_pages(“title_li=&child_of=147”.$post->ID.”&echo=0″);
// diplays only the subpages of parent level
//$children = wp_list_pages(“title_li=&child_of=”.$post->post_parent.”&echo=0″);

// now you can get the the top ID of this page
// wp is putting the ids DESC, thats why the top level ID is the last one
$ancestors = end($post->ancestors);
$children = wp_list_pages(“title_li=&child_of=”.$ancestors.”&echo=0″);
// you will always get the whole subpages list

if ($children) { ?>

Skip to content