how to display sub sub level pages
-
Hi.
I am trying to create a dynamic menu that I can show all related child pages but i have run into a small problem. the current system will show all children when on a top level page and a sub page, however, when I am on a page 3 levels deep (sub sub page) I can only display the pages related to the sub sub page. I just need to show level 2 and any related children.
example:
Top level
– sub page
– – sub sub pagehere is the code i am using in my template this far:
<?php
if($post->post_parent)
$children = wp_list_pages(“title_li=&child_of=”.$post->post_parent.”&echo=0″);
elseif ($post->post_parent->post_parent)
$children = ‘test’;
else
$children = wp_list_pages(“title_li=&child_of=”.$post->ID.”&echo=0″);if ($children) { ?>
-
<?php echo $children; ?>
<?php } ?>
- The topic ‘how to display sub sub level pages’ is closed to new replies.