On hierarchal pages 3 levels deep, I would like to display the grandchildren on child and grandchild pages (but not on the parent page). What I have so far displays the grandchildren on the child page but I'm confused on how to keep them displayed on the grandchildren pages. How can I do this?
<?php
//display children's child pages
$childrens_children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
if ( is_page() && $post->post_parent > 0 ) {
?>
<aside id="child-child-pages" class="widget widget_child_child_pages">
<ul>
<?php echo $childrens_children; ?>
</ul>
</aside>
<?php } ?>
The idea
Parent : show nothing
Child : show grandchildren of parent
Grandchild : show grandchildren of parent