現在表示しているページに、親ページ又は、子ページが存在する場合は、それらを表示する
page.phpなどで、
<?php
$current_page_id= get_the_ID();
$ancestor = array_pop( get_post_ancestors( $current_page_id ) );
if( empty( $ancestor ) ){
$my_id= $current_page_id;
$add_query= '&title_li=This page childs';
}else{
$my_id= $ancestor;
$add_query= '&title_li=<a href="'.esc_url( get_permalink( $my_id ) ).'">'.get_the_title( $my_id ).'';
}
wp_list_pages('child_of='.$my_id.$add_query);
?>