OK, after much trial and error, I figured it out. I'll post my code here so that someone less may be able to benefit from it some day.
PHP Code:
/*-----------------------------------------
Check if a page has any children / subpages
-----------------------------------------*/
function has_children(){
global $post;
if( ($post->post_parent == 0 && wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0'))
||
($post->post_parent > 0 && wp_list_pages('title_li=&child_of='.$post->post_parent.'&echo=0'))
){
return true;
} else {
return false;
}
}
if(!function_exists('get_post_top_ancestor_id')){
/**
* Gets the id of the topmost ancestor of the current page. Returns the current
* page's id if there is no parent.
*
* @uses object $post
* @return int
*/
function get_post_top_ancestor_id(){
global $post;
if($post->post_parent){
$ancestors = array_reverse(get_post_ancestors($page->ID));
return $ancestors[0];
}
return $post->ID;
}}
add_action ('genesis_before_post_title', 'subpage_nav');
function subpage_nav(){
if ( is_page() && has_children($post->ID) ) {
echo '<div id="pagenav">' . '<ul class="clearfix">';
wp_list_pages( array('title_li'=>'','include'=>get_post_top_ancestor_id()) );
wp_list_pages( array('title_li'=>'','depth'=>1,'child_of'=>get_post_top_ancestor_id()) );
echo '</ul>' . '</div>';
}
else{
}
}