Title: Custom Menu Solution
Last modified: August 20, 2016

---

# Custom Menu Solution

 *  [foochuck](https://wordpress.org/support/users/foochuck/)
 * (@foochuck)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/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?

Viewing 1 replies (of 1 total)

 *  Thread Starter [foochuck](https://wordpress.org/support/users/foochuck/)
 * (@foochuck)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/custom-menu-solution/#post-2216881)
 * Is there a way to give each sub-menu a custom class?
 * The default is ‘sub-menu’.
 * Currently it is: `<ul class="sub-menu">`
 * But I’d like to change it to: `<ul class="about-sub-menu">`

Viewing 1 replies (of 1 total)

The topic ‘Custom Menu Solution’ is closed to new replies.

## Tags

 * [dynamic menu](https://wordpress.org/support/topic-tag/dynamic-menu/)
 * [menu](https://wordpress.org/support/topic-tag/menu/)
 * [submenu](https://wordpress.org/support/topic-tag/submenu/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [foochuck](https://wordpress.org/support/users/foochuck/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/custom-menu-solution/#post-2216881)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
