Keep page hierarchy in wp_list_pages, even if on a child or grandchild
问题 I have the following structure of pages, and I need to have that same structure displayed on those pages who have child pages: - Childpage - - Grandchildpage - - Other Grandchildpage - Other Childpage The following code is used to display the structure on page.php: <ul class="sidemenu-list"> <?php if($post->post_parent) $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=1"); else $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=1"); if ($children) { ?>