Custom Menu Solution
-
I’m working on a WordPress site with a custom menu. Here’s how it breaks down:
About Page (sub-menu)
Contact Page (sub-menu)
Info Page (sub-menu)I’m setting up one main menu for navigation, but here’s the catch: within that menu, each page will have sub-menus – the sub-menus will only appear when you are on that page.
For example if you are on the About Page (or any of it’s sub pages) the sub-menu for About will appear – other sub-menus (such as Contact & Info pages) will by hidden.
These are not drop down menus, but rather sub menus that appear on each page.
Below is the html markup for the About us section of the menu for example:
<ul> <li>About Us <ul> <li>About Sub Link 1</li> <li>About Sub Link 2</li> <li>About Sub Link 3</li> </ul> </li>
I’m looking for suggestions on how I can hide menus when you are not on that main page or it’s sub-pages. Obviously I know I can hid it with CSS, but I need to set this up dynamically with PHP.
Any suggestions?
- The topic ‘Custom Menu Solution’ is closed to new replies.