Support » Fixing WordPress » Subpage list navigation on all pages under parent

  • I have a site that has a main horizontal navigation bar with lists the three topmost pages in my site. I have a few levels of subpages under each main page, and when I dive into one of the sections, I would like to show all of the subpages as a nested list in the sidebar. For example…

    Main navigation:

    Page ONE | Page TWO | Page THREE

    If I go to ANY page that is a subpage under Page ONE, in the sidebar I would like to show:

    PAGE ONE

    • Subpage A
      • Subpage Aa
      • Subpage Ab
      • Subpage Ac
    • Subpage B
    • Subpage C
      • Subpage Ca
      • Subpage Cb
    • Subpage D
    • Subpage E

    Any thoughts?

Viewing 3 replies - 1 through 3 (of 3 total)
  • I’ve found this the other day here in the forum (by searching for display children pages and similar keywords), just don’t remember where…
    <?php
    $thispage = $wp_query->post;
    if($thispage->post_parent!=0)
    {
    wp_list_pages("title_li=&child_of=".$thispage->post_parent);
    }
    else
    {
    wp_list_pages("title_li=&child_of=".$thispage->ID);
    }
    ?>

    Ahni

    (@ahni)


    Perfect! Thanks.

    kitkaplan

    (@kitkaplan)


    I am using Regulus and having trouble with subpages. I have the same set up, a few horizontal links at top but sublevels 3 deep. Only the first level of subpages shows up and the link does not go deeper. Can I use his and where does it go? I am php illiterate.

    This is the site
    http://p10.hostingprod.com/@onespiritinterfaith.org/seminary

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Subpage list navigation on all pages under parent’ is closed to new replies.