I use the following code to load subpages in a sidebar on all pages:
<?php $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0&depth=1'); if ($children) { ?> <ul id="three-menu"> <?php echo $children; ?> </ul> <?php } ?> It works well on all pages with sub pages or children. But what if I want this sidebar with children pages to load with parents]when there are no children? What code to add to another if or elseif? Basically I need to add a No children? Then loads parent pages..
Update:
At http://www.fldtrace.com/wordpress/how-to-display-parent-page-title-in-wordpress I found this code to load the parent page link:
<?php $parent_title = get_the_title($post->post_parent);?> <a href="<?php echo get_permalink($post->post_parent) ?>"><?php echo $parent_title;?></a> Which is great, but I need to list all parent pages, which are sub pages of the grand parent...