Child pages of parent page menu in sidebar

You can also use this plugin:
if u want add main title as main page then use this plugin:
by default all childpages short by name, if u want add desiding order then:
got to plugin’s => edit => and replace this line
$pages = wp_list_pages(‘depth=0&title_li=&child_of=’.$id.’&echo=0&sort_column=menu_order’);

past in sidebar.php 

<?php global $post;?>
$parent_title = get_the_title($post->post_parent);
$children = wp_list_pages(“depth=1&title_li=&child_of=”.$post->post_parent.”&echo=0″); // append the list of children pages to the same $children variable
if ($parent_title) { ?>
<h2 class=”widgettitle”><?php echo $parent_title; ?></h2>
<?php }

if ($children) { ?>
<ul class=”submenu”>
<li><?php echo $children; /*print list of pages*/ ?></li>
<?php } ?>


Tagged: , , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s