two level child page?
-
The structure of my site is as following
<ul> <li>Master 1</li> <ul> <li>First Child 1</li> <li>First Child 2</li> <ul> <li>Second Child 1</li> <li>Second Child 2</li> </ul> </ul> <li>Master 2</li> </ul>
When clicking on the Master 1, I correctly display the First Child 1 page. Also, adding depth=1 in the following code, I get to display only child pages of first level.
The problem is that when I clink on First Child 2, I can not display the navigation with the second level child pages (Second Child 1 and 2).
How should I do? I would also like to display this second level of child pages into a widget.The code I’m using is the following. Thanks
<?php if($post->post_parent) $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0&depth=1"); else $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0&depth=1"); if ($children) { ?> <div id="sub-nav"> <ul class="sub-nav" style="display:inline"> <?php echo $children; ?> </div> <?php } ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘two level child page?’ is closed to new replies.