Title: menu with submenu
Last modified: August 19, 2016

---

# menu with submenu

 *  [froggyfrog](https://wordpress.org/support/users/froggyfrog/)
 * (@froggyfrog)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/menu-with-submenu/)
 * Hi there,
 * I need some help with a menu in my custom theme in wordpress.
 * I basically have a mainnav and some of the mainnav options will have a subnav.
   All this is added in the worpress admin area and can change at anytime.
 * I need to display the mainnav and if the user selects an option that has a subnav
   I need to show the subnav for that item. This subnav should only show if the 
   parent for the subnav is active.
 * Is there anyway of doing this in wordpress? I have always used php and folders
   in the past but this is a dynamic created nav.
 * Thank you in advance.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [datasoftict](https://wordpress.org/support/users/datasoftict/)
 * (@datasoftict)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/menu-with-submenu/#post-1791945)
 * I would look at using css Z-index, visibility or display on the a:hover tag for
   this type of thing.
 * > [http://www.w3schools.com/Css/css_examples.asp](http://www.w3schools.com/Css/css_examples.asp)
 * has some more info.
 *  Thread Starter [froggyfrog](https://wordpress.org/support/users/froggyfrog/)
 * (@froggyfrog)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/menu-with-submenu/#post-1791948)
 * Hi there, thanks for your help. Z-index just layers items and visibility will
   just hide the menu.
 * I need some kind of jquery script to check if the active menu item has a subnav
   and if yes to show that subnav. The hide the subnav once another menu item is
   selected.
 * Any ideas?
 * I have this so far:-
 *     ```
       $(function(){
       	$('ul.subnav').hide();
   
       	$('ul.mainnav a#active').mouseover(function(){
       		$('ul.subnav').show();
   
       	return false;
       	});
       });
       ```
   
 * It doesn’t quite work how I want it to tho.
 * Any ideas?
 *  [datasoftict](https://wordpress.org/support/users/datasoftict/)
 * (@datasoftict)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/menu-with-submenu/#post-1791954)
 * > It doesn’t quite work how I want it to tho.
   > Any ideas?
 * Not really as I don’t know how you want it to work.
 * There are lots of JS menu dropdowns/slideouts etc out there at places like codespy
   and tutorio. See which is nearest your needs and see how they do it.
 *  Thread Starter [froggyfrog](https://wordpress.org/support/users/froggyfrog/)
 * (@froggyfrog)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/menu-with-submenu/#post-1791962)
 * Basically there is a subnav for some of the mainnav items but not all of them.
 * When the user selects an option with a subnav I want that subnav to show. If 
   the user selects another option on the mainnav then I need the subnav to not 
   show.
 * If you look at this site [http://www.claireprice.com](http://www.claireprice.com).
   Thats how I need my nav to work. If you click on the Advanced treatments option
   a subnav appears. If you select Job opportunities then the subnav for the advanced
   treatments gets hidden.
 * Does this help you understand what I’m after?
 * Thank you
 *  [datasoftict](https://wordpress.org/support/users/datasoftict/)
 * (@datasoftict)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/menu-with-submenu/#post-1791966)
 * Try something like
 * > [http://www.tutorio.com/tutorial/javascript-expanding-menu](http://www.tutorio.com/tutorial/javascript-expanding-menu)
 *  and see it it is what you want.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘menu with submenu’ is closed to new replies.

## Tags

 * [Subnav](https://wordpress.org/support/topic-tag/subnav/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [datasoftict](https://wordpress.org/support/users/datasoftict/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/menu-with-submenu/#post-1791966)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
