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
Portfolio
— Print
— —?sample 1
— — sample 2
— — sample 3
— Web
— — sample 1
— — sample 2
— — sample 3
— Illustration
— — sample 1
— — sample 2
— — sample 3
Services
About
ContactWhat I’m trying to achieve:
Level one links always visible:
Print Services About ContactWhen the active page is Portfolio I would like the children of Portfolio to also display like:
Print Services About Contact
Print Web IllustrationI 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"> <ul> <?php wp_list_pages('title_li=&depth=1&exclude=6'); ?> </ul> </nav>
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.