WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Listing Sub Pages in Sidebar

[Resolved] Listing Sub Pages in Sidebar

  • Hi

    Does anyone know a way I can display all of my subpages in the sidebar of my site, irrespective of whether you are currently on the parent page.

    At the moment, I am using the following code – but this only shows the subpages when you are on the parent page. I want to show all subpages in one list, throughout the site.

    <?php
    if($post->post_parent)
    $children = wp_list_pages("sort_column=menu_order&title_li=&child_of=".$post->post_parent."&echo=0"); else
    $children = wp_list_pages("sort_column=menu_order&title_li=&child_of=".$post->ID."&echo=0");
    if ($children) { ?>
    <ul>
    <?php echo $children; ?>
    </ul>
    <?php } ?>
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Resolved] Listing Sub Pages in Sidebar’ is closed to new replies.