Support » Fixing WordPress » wp_list_pages to show Parent and Child links only

  • Hi all,

    I’m still getting acquainted with WPs features on this menu scenario has me stumped.

    Here is the structure of my Pages

    — Print
    — — sample 1
    — — sample 2
    — — sample 3
    — Web
    — — sample 1
    — — sample 2
    — — sample 3
    — Illustration
    — — sample 1
    — — sample 2
    — — sample 3

    What I’m trying to achieve:

    Level one links always visible:
    Print Services About Contact

    When the active page is Portfolio I would like the children of Portfolio to also display like:
    Print Services About Contact
    Print Web Illustration

    I do not want the grandchildren of Portfolio to display.

    I’ve been digging into the Codex and have tried every variation listed on this page and can’t find one that returns the above scenario.

    Here is my current code for <nav>

    <nav class="main-nav">
    <?php wp_list_pages('title_li=&depth=1&exclude=6'); ?>

    Here is a link to website

    Any suggestions?

  • The topic ‘wp_list_pages to show Parent and Child links only’ is closed to new replies.