Title: Parent menu active when submenu active
Last modified: August 22, 2016

---

# Parent menu active when submenu active

 *  Resolved [gnorf](https://wordpress.org/support/users/gnorf/)
 * (@gnorf)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/parent-menu-active-when-submenu-active/)
 * Hey there
 * excellent theme and thanks for providing!
 * One thing I was wondering about.
 * When a submenu (level 2) is selected, and displayed active, how can I make parent/
   main menu also be displayed as active? What should be inserted and where?
 * This is particularly relevant where main menu item is not in use (or with #) 
   and everything is organized in submenus.
 * Many thanks in advance!

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

 *  [Jesin A](https://wordpress.org/support/users/jesin/)
 * (@jesin)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/parent-menu-active-when-submenu-active/#post-5813172)
 * Place the following CSS code in the Custom CSS box:
 *     ```
       .main-navigation .current_page_parent > a {
         background-color: #ddd;
         border-top: 3px solid #222;
         padding-top: 17px;
       }
       ```
   
 *  Thread Starter [gnorf](https://wordpress.org/support/users/gnorf/)
 * (@gnorf)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/parent-menu-active-when-submenu-active/#post-5813177)
 * Thanks very much but unfortunately it did not work. I also tried to insert the
   code below
 *     ```
       .main-navigation .current_page_item > a {
       	background: #ddd;
       	border-top: solid 3px #222;
       	padding-top: 17px;
       ```
   
 * No change, when submenu is active main menu remains inactive.
 *  [Jesin A](https://wordpress.org/support/users/jesin/)
 * (@jesin)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/parent-menu-active-when-submenu-active/#post-5813186)
 * It is `.current_page_parent` and **NOT** `.current_page_item`.
 *  Thread Starter [gnorf](https://wordpress.org/support/users/gnorf/)
 * (@gnorf)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/parent-menu-active-when-submenu-active/#post-5813201)
 * Now I am slightly confused. sorry.
 * I know the differences, does this mean your code shall replace the one in the
   css? I inserted yours below the one quoted. Which was in the sheet
 *  Thread Starter [gnorf](https://wordpress.org/support/users/gnorf/)
 * (@gnorf)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/parent-menu-active-when-submenu-active/#post-5813202)
 * Well as removing that means menu will not show active even when active I guess
   they should complement each other. But it still won’t work.
 *  [Jesin A](https://wordpress.org/support/users/jesin/)
 * (@jesin)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/parent-menu-active-when-submenu-active/#post-5813217)
 * The code should be added in **WP-Admin > Appearance > Coller Settings > Custom
   CSS**. But turns out that the **>** character is converted to `&gt ;` in this
   file 🙁
 * So create a [child theme](https://codex.wordpress.org/Child_Themes) and place
   the code in its **style.css** file.
 *  Thread Starter [gnorf](https://wordpress.org/support/users/gnorf/)
 * (@gnorf)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/parent-menu-active-when-submenu-active/#post-5813243)
 * Thanks, yes I did that and I also saw the additional characters + removed them.
 * Either way, via the custom CSS box or by direct insert into style.css, didn’t
   work. Main menu remains inactive if submenu is active on page select.
 *  [Jesin A](https://wordpress.org/support/users/jesin/)
 * (@jesin)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/parent-menu-active-when-submenu-active/#post-5813249)
 * Please post your site’s URL.
 *  [Jesin A](https://wordpress.org/support/users/jesin/)
 * (@jesin)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/parent-menu-active-when-submenu-active/#post-5813337)
 * Try this:
 *     ```
       .main-navigation .current-menu-parent > a {
         background-color: #ddd;
         border-top: 3px solid #222;
         padding-top: 17px;
       }
       ```
   
 * The previous code I posted works only for subpage menus. But this code should
   work.
 *  Thread Starter [gnorf](https://wordpress.org/support/users/gnorf/)
 * (@gnorf)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/parent-menu-active-when-submenu-active/#post-5813339)
 * BINGO! Awesome! Thanks a million Jesin!
 * I was pondering over that but too rusty with rgds CSS to make a sensible deduction/
   arrive at a sensible conclusion. One learns something new every day! 🙂
 *  [Jesin A](https://wordpress.org/support/users/jesin/)
 * (@jesin)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/parent-menu-active-when-submenu-active/#post-5813340)
 * You’re welcome!
 * Use the inspect mode (F12) of your browser to pin point an element on the webpage
   and get its code.
 * Also please mark this thread as resolved if things are done.
 *  Thread Starter [gnorf](https://wordpress.org/support/users/gnorf/)
 * (@gnorf)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/parent-menu-active-when-submenu-active/#post-5813341)
 * Yessir will do! I did use the inspector but was not sure about the css state 
   term to be used.
 * Case closed 🙂

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

The topic ‘Parent menu active when submenu active’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/coller/2.0.5/screenshot.png)
 * Coller
 * [Support Threads](https://wordpress.org/support/theme/coller/)
 * [Active Topics](https://wordpress.org/support/theme/coller/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/coller/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/coller/reviews/)

 * 12 replies
 * 2 participants
 * Last reply from: [gnorf](https://wordpress.org/support/users/gnorf/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/parent-menu-active-when-submenu-active/#post-5813341)
 * Status: resolved