Try using the following code.
.current-menu-ancestor > ul {
display:block;
}
The class current-menu-ancestor appears if the current item is a parent of a current page item.
Related Posts:
- wp_nav_menu: show menu only if one exists, otherwise show nothing
- Making breadcrumb with wp_nav_menu
- Unregister Nav Menu from Child-Theme
- Deleted pages are NOT removed from custom menus?
- How to add active class on current menu item page?
- Keeping parent menu items active in child pages
- Add Page ID class to nav menu items
- Way to bulk delete menu items in new 3.x Appearance > Menus system?
- Pass a parameter to a menu walker
- Menu is not visible in appearance
- WordPress nav_menu_link_attributes Not Working
- Customize the menu by adding items
- Nav Menu and display post count
- wp_nav_menu log in/out link?
- Accesibility problems with dropdown menus in twentyten theme or others
- Theme menu in Admin Panel
- How to target children of child pages
- How to insert custom code into wp_nav_menu structure?
- Adding post excerpt into navigation menu
- Editing WordPress Nav Menu Walker
- WordPress Admin Bar Covering & Overlapping Fixed Menu Header [closed]
- Remove current class from sub menu items
- How to change menu URLs to hashes?
- How do I render a navigation menu like my theme does?
- WordPress Menu Prepends URL To My Anchors
- How to handle many different menus?
- Check if menu_item has children or has parent
- Why is wordpress forcing https link generation?
- wp_page_menu not working right?
- using OOP approach to create plugin but stuck at making hyperlinks to work
- pull non-wp site into content area of wordpress -or- pull wp header into non wp site?
- cross-site custom menu
- How to remove the HOME menu item
- Adding menu items?
- Adding existing links to custom navigation menus?
- How to get rid of the home link in nav menu?
- How to truncate menu label in wordpress?
- Is it possible to add a dynamic link in the main navigation in a child theme
- How to change the location of the menu
- How can I make a menu link visible only to admins (without plugins)?
- magic “MENU” button under Twenty Twelve theme
- Remove first separator in wp_nav_menu
- wp_nav_menu check both hierarchy fail?
- change hover color of specific menu link [closed]
- How can I make a WordPress sub-menu with a top-level that isn’t clickable?
- How do add a menu with levels within page [closed]
- WordPress classes removed when using custom walker
- Get parents child pages
- menu-item class missing on wordpress menu
- how to add home icon instead of text in wordpress menu
- Active class to current link
- Making pages in a menu appear conditionally
- Modify the output of wp_nav_menu in a very specific way?
- How to add a menu that belongs to parent blog to all child-blogs?
- How to create this kind of sub-menu in new line?
- How to use wp_list_pages on a grandparent page
- How to add social buttons like facebook and twitter in the footer of a theme?
- WordPress Menu – creating a fake link [closed]
- Understanding with this WordPress code
- How to add an archive page to WordPress menus (nav_menu)?
- Add div content to my already existing menu
- Add category label for appearance > menus items
- Custom items for Menus
- Menu flickering with each refresh on Google Chrome [closed]
- dot.com/car1 does work, but dot.com/transport/car1 doesn’t work
- Remove Double Menu in Mobile View and Have one Menu Only
- calling JS to custom menu design
- WP pages content is missing in frontend
- How to get rid of the bottom line in the navigation menu via CSS file?
- Active menu item state on all menu items
- Dashicons not showed for admin menu
- How to select particular menu position in wordpress?
- Menus not visible in Appearance after being registered
- Error: Declaration of MyClass::start_lvl() should be compatible with that of Walker_Nav_Menu::start_lvl()
- Cannot add home page url to menu with #
- Installing compact search in the main menu?
- Having an issue with wp_nav_menu displaying custom navigation
- Add dynamic content block to nav section generated by custom walker
- Customizing label/title output of admin nav_menu selecter
- Extend Individual Menu on Page Function to individual Submenue on Page Function?
- Menu administration, how to allow special charachters
- How to avoid website url appending problem in wp site?
- Create custom page and custom menu
- Get first menu item of custom menu
- How can I modify wp_nav_menu with walker?
- menu items outside of blog
- Bought custom navigation menu from codecanyon, how to change feature.php?
- Custom menu linking to page not found
- How to insert date in topNav
- Change sub-menu css class
- How to add an tag when a menu item is a dropdown(or has a sub-menu) [duplicate]
- Somehow lost my MENU from my home page- help!
- How to completely remove the top section with the menu?
- How to display a submenu as a popup when clicking a button?
- how can i get the page_ID in nav li [closed]
- How do i add logo in wordpress studiopress (glam theme)?
- What is the best way to incorporate responsive dropdown navigation menu into custom theme?
- Submenu items not working anymore
- Icon not shown in Dropdown menus in Twenty Seventeen Theme
- How to change WP menu item type?