views:

5

answers:

1

Hi There,

I am building a wordpress site and in the sidebar I wanting to show the sub nav of the section the user in, so I would like to show something like if they were on the about page,

About Links Useful Contacts

However at the moment I have only managed to the child pages out (Links, Useful Contacts), how would I show the show the parent link as well currently my code looks like this,

if($post->post_parent)
              $children .= wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
          else
              $children .= wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
              if ($children) { ?>
                  <ul>
                      <?php echo $children; ?>
                  </ul>
              <?php } ?> 
A: 

Which version of WP are you using? If you are using > 3.0, then you should start using wp_nav_menu. It's a lot more managable.

But here is a good tutorial on how to use sub-navigation in WP:
http://www.svennerberg.com/2009/02/creating-a-submenu-in-wordpress/

Steven