Custom sidebar menu structure
-
Hello WordPressers,
I have a question on setting up a “custom” sidebar navigation.
There are 3 levels of navigation shown on the page, spread across multiple sections. My desired outcome is that everything under the current current_page_ancestor would be visible (all child pages) and that any child pages from other 1st level parents would not to be displayed.
An example of the page tree looks like this:
Mission & Programs
-History
-Pizza Services
-Vocational ServicesBusiness Attractions
-Farmyard
–Field Trips
–Membership
-Brick oven
-Nettle patchBoth of these are contained within a parent page.
Given the above structure when you are on the Farmyard page all pages under Business Attractions should be visible, but only Mission & Programs (none of the child pages).
So far I have been able to achieve a bit of the nesting and display I want using this code:
[Code moderated as per the Forum Rules. Please use the pastebin]
But it shows all the pages contained within the overarching parent. If anyone can lend some assistance in how I would achieve this menu that would be great, please let me know if I can provide clarity on any of these points, thanks!
- The topic ‘Custom sidebar menu structure’ is closed to new replies.