WordPress show link of parent and child pages

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

Read More

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 } ?> 

Related posts

Leave a Reply

1 comment