You could use .current-menu-parent
and/or .current-menu-ancestor
.
Related Posts:
- Retrieving a list of menu items in an array
- Error: Declaration of MyClass::start_lvl() should be compatible with that of Walker_Nav_Menu::start_lvl()
- Is there an easy way to replace a custom menu link with a page or post?
- Using nonce in menu item
- Filter out built-in wp_nav_menu classes but keep custom class
- remove last separator?
- How show sub menu only using wp_nav_menu()
- How to get a different mobile menu than desktop menu in the twentytwelve child theme
- WordPress built in breadcrumb trail menu?
- Custom Nav Walker menu – Display children count
- WordPress Export Import Site Navigation Menu
- Bar separated navigation by extending Walker_Nav_Menu
- WordPress Menu Disappears when $query->query_vars[‘meta_key’] is set
- how do I delete (not exclude) a menu item from navigation bar
- show only a given level in nav menu
- Custom menus created but does not show up in admin panel
- Replace menu tag with tag
- How to display custom post meta in the appearance->menus page
- Anchor only wp_nav_menu
- wp_nav_menu custom walker – child items
- Where do custom menus get constructed?
- How to remove div container in custom menu?
- Keeping ‘current-menu-item’ highlight of navigation menu?
- Does loading of sub pages in menu cause load to the server?
- Get admin menu link
- Possible to add a dynamic link to a sub-menu via wp_nav_menu_items?
- How can I access the menu ID of an element in a WordPress Nav_Walker
- Fragment URL in navigation item without a custom link
- How to translate menu items?
- echo same menu items across multi-site platform
- Unable to create or edit menus
- Displaying primary nav menu two ways
- How to Implement Submenu Using wp_nav_menu
- Close dropdown menu on click or scroll outside the menu [closed]
- How to have the Header show different content on different pages?
- WordPress menu not loading in the admin side appearence-> menu tab
- Is there no straightforward way to display a separate second level using wp_nav_menu()?
- CSS_Menu_Walker not showing on mobile view?
- wp_nav_menu() doesn’t work
- Insert other menus as submenus of a main menu
- Help with walker for nav
- wp_list_pages sort order by custom nav menu order
- Move Sticky Nav Menu Below WordPress Tool bar when tool bar enabled
- Prevent menu from loading in a page template [duplicate]
- How to use wp_nav_menu with hashtag links?
- Rename menu items for All except super admin
- Displaying Nav Menu
- Get Menus In Header.php FIle
- Add custom link on the fly to nav menu
- Custom register_taxonomy ins’t showing custom Nav menu
- Conditional menus based on page title
- How to test if a specific page is the front page?
- Strange menu behaviour wordpress admin [duplicate]
- Menu deletes all items and position – wordpress bug?
- Mobile navigation is shown, but standard navigation does not disappear
- Plugins & Setting Menu Items Removed From Admin Panel
- Lost admin “manage_link” capability WordPress. No “Links” menu item in admin menu
- How to add active class to separate page link?
- Controlling sub-menu within sub-menu
- Main menu navigation links and new pages
- How are methods of class Walker_Nav_Menu invoked?
- Multisite: menus can’t be added in child sites
- How to get the Page Name of the current page?
- Add/remove image from navigation bar
- Swap out a page that is a parent to a many many pages
- How can I order these pages in this navigation bar on this old wordpress theme?
- Modifying Woocommerce menu based on tags and categories
- How To add this tag before drop-down ul. in wordpress
- Unable to get Navigation Menu to display in the desired location
- Add href to tag in nav menu for mobile
- How to change navwalker’s dropdown mark-up?
- Bootstrap navbar responsiveness on WordPress theme menu not working
- Creating custom vertical menu
- Enable identical menu on network sites
- Show navigation header menu by post and categery
- How to add buddypress sub-menu items to other menus
- Custom location for menu
- No indication of menu
- Adding a menu item to the main menu
- wp_is_mobile() inside js
- How to select single category in menu if post have two categories?
- menu is only pulling in one item
- Any reason why widgets/menus get emptied when I updated custom theme code?
- How to get current menu item “CSS Classes” value?
- How to change page location in WordPress
- Set menu item class into body
- how to keep theme background image, menu or site header image while moving site in sub directory?
- Creating a custom menu
- List WordPress Custom Menu’s active parent level’s children as separate menu
- Unable to edit Navigation bar
- Editor user only allow to post on certain categories
- Menu Underline shows without Hover after adding subitems
- How to create a custom WordPress navigation menu?
- Should I custom code drop down menus or use a wordpress plugin?
- WordPress “add to menu” button not working
- Primary menu shortcode name
- register_nav_menus and wp_nav_menu issue, not displaying independent menus
- Convert a custom bootsrap based menu to wordpress nav walker
- How do I get the menu items based on name or ID?
- Problems with the navigation menu