WordPress.org

Ready to get started?Download WordPress

Forums

Tiered Sidebar Navigation by current page (1 post)

  1. dyelawn
    Member
    Posted 2 years ago #

    Trying to use wp_list_pages to create tiered subpage sidebar navigation. I've produced the same effect hand-coding PHP, but having trouble making it fit with the WordPress code base.

    I've tried copying, pasting, and slightly altering the code in the codex, as well as creating arrays with custom queries to use in the 'include' parameter. Nothing has worked. I've also searched the forum for similar problems and none of the solutions offered produce the desired effect.

    The site has three generations in the hierarchy.
    - About
    - People
    - Person A
    - Person B
    - Company
    - History
    - Products
    - Widgets
    - Cool Widgets
    - Cooler Widgets
    - Sprockets
    - Spacely Sprockets
    - Barbara Sprockets

    ....etc.

    The effect I'm looking for is to have a dynamically loading list in the sidebar that shows pages on the top-level (About, Products) when on a top-level page. When on a sub-page (Widgets, Sprockets), the list would display all pages in that generation, and the children of the current page. When on a sub-sub-page (Cool Widgets), the list would display in the same manner as on a sub-page.

    So:

    On Products page

    Top Level Pages
    - About
    - Products

    On Sprockets Page

    Products
    - Widgets
    - Sprockets
    - Spacely Sprockets
    - Other Sprockets

    On Spacely Sprockets Page

    Products
    - Widgets
    - Sprockets
    - Spacely Sprockets
    - Other Sprockets

    Thanks in advance for any help.

Topic Closed

This topic has been closed to new replies.

About this Topic