Sub-navigation for child pages (help needed)
-
I’m after a script which lists all the child pages of a parent page, but without including them in the same unordered list as the main navigation. At the moment, my navigation script looks as follows;
<div class=”nav clearfix”>
-
<li <?php if(is_home()){echo ‘class=”current_page_item”‘;}?>>” title=”Blog”>Blog
<?php wp_list_pages(‘title_li=&depth=1’);?></div>
The above script tells WordPress to pull up all parent pages in an unordered list and to slot any child pages in a list item next to the relevant parent page list item. I need a separate script that *only* pulls up child pages, and in a ‘sub-navigation’ style unordered list. I’m working on a tabbed interface, so I need the child pages to also have a ‘current_list_item’ selector for selected pages.
I intend to put the sub-navigation further down in the layout from the main navigation – you can see my existing navigation on https://DotNeil.com.
Any help is much appreciated!
- The topic ‘Sub-navigation for child pages (help needed)’ is closed to new replies.