'; return $str; } } // prints out a list of the current page's children or siblings in a widget div function asfp_subpages_nav() { global $post; if (is_page() && !is_404() && !is_search() && !is_front_page()) { // If CHILD_OF is not NULL, then this page has a parent // Therefore, list siblings i.e. subpages of this page's parent if ($post->post_parent) $thelist = wp_list_pages('echo=0&title_li=&depth=2&sort_column=menu_order&child_of='.asfp_get_ancestor()); // If CHILD_OF is zero, this is a top level page, so list subpages only. else $thelist = wp_list_pages('echo=0&title_li=&depth=2&sort_column=menu_order&child_of='.$post->ID); if (!empty($thelist)): if ($post->post_parent) $sectitle = get_the_title(asfp_get_ancestor()); else $sectitle = get_the_title($post->ID); ?>
post_parent) { $ancestor = get_posts('post_type=page&include='.$post->post_parent); if ($ancestor[0]->post_parent) return $ancestor[0]->post_parent; else return $post->post_parent; } else return false; } ?>