How to create a sidebar navigation in WordPress
Here’s a snippet that will give you an instant sidebar navigation in WordPress. It grabs the post parent title and the children of that parent.
<div id="sidebar-nav">
< ?php if($post->post_parent) { ?>
< ?php $parent_title = get_the_title($post->post_parent); ?>
< ?php $permalink = get_permalink($post->post_parent); ?>
<h3><a href="<?php echo $permalink; ?>" title="< ?php echo $parent_title; ?>">< ?php echo $parent_title; ?></a></h3>
< ?php } else { ?>
<h3><a href="<?php echo get_permalink(); ?>" title="< ?php echo $parent_title; ?>">< ?php the_title(); ?></a></h3>
< ?php } ?>
< ?php
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 } ?>
</div>Related posts:

May 30th, 2011 at 2:52 am
Nice Article.
Once visit http://www.wordpressstop.com here you will find lot of articles regarding to WordPress.
keep Smiling