It sounds like you may be over-complicating this. If your goal is to highlight a post’s top parent while the post is listed in a sub-menu of said parent, then this is a CSS problem, not a wordpress one. The following should work:
.current-menu-parent a, .current-menu-ancestor a {
color: #7dca8d;
}
Related Posts:
- Menu items description? Custom Walker for wp_nav_menu()
- How to add posts to custom menus?
- wp_nav_menu(), how to change class?
- Display Menu Name using wp_nav_menu
- Add custom classes to anchor in wp_nav_menu
- How to limit wordpress menu depth in admin panel
- How do I check if a menu exists?
- How to use logout function on custom menu link?
- How to display wp_nav_menu() conditionally only when not on a 404 page?
- How to add menu support to a theme?
- Problem with registering menus – What to do when other solutions aren’t working?
- Add a #hash to the links in my custom menu
- How can i change menu link when page content empty?
- Select menu on browser resize
- Extend walker – navigation, adding data attribute to a tag
- How to add (css) classes to only one wp_nav_menu()?
- Replace Home with image link inside custom header menu
- Displaying wp menus by name without using theme locations
- How do I add a post to a menu
- how to change WordPress menu markup/classes
- WordPress nav_menu_css_class theme filter is not being called
- Best practices: Custom theme sidebar menu – hardcode or widget?
- Create self-populating menu and add extra divs to the menu layout
- Where is definied the theme location for the main menu in a WordPress template?
- How to remove class attributes from custom menu markup?
- 2 differen’t menus and it’s using same items in both
- menu behavior is not as expected
- Is there an action for save_menu and/or update_menu?
- Part of Menu Item Hidden on Header Menu
- wp_nav_menu add something before closing container and after last list item
- Find the Children of a Page then Echo it as a Bulleted List of Links (menu)
- which is the best way to customize nav-menu-template.php?
- Create wordpress header with custom logo in between the menu splitting the menu into two equal parts [closed]
- WordPress navbar with logo in middle [closed]
- My Admin bar covers my sticky navbar [closed]
- WordPress is adding margins and padding to my custom menu?
- Menu item added in wp_nav_menu_items filter is never highlighted
- wp_post->post_parent object returning 0
- multisite: global menu containing network site links?
- How to make theme elements customizable in wordpress?
- Single-level menu option? Another way?
- Primary navigation menu & footer not showing in category / tag page
- Using a page as home, how do I prevent nav from setting both home and page links active?
- How to append to menu items selectively
- Issue on Adding A Class to Bootstrap Navbar Walker Dropdown
- Show woocommerce categories on my theme menu styling
- Why does has_nav_menu return false when get_registered_nav_menus shows the opposite?
- Admin: sub menu doesnt display under apperance when activate my themes
- Child Theme header1.php file not overwriting parent theme’s header1.php file
- 3 Level Deep Navigation Menu Not Showing All Levels
- How to Create custom xml file for demo content for custom theme?
- How to create and populate with few links a menu in child theme functions.php?
- Second menu has the first menu ID
- How to add menù section to my WordPress template?
- wp_nav_menu and its fallback
- Theme development – Automatically menu creation
- Theme development: How to add CSS classes to menu items?
- Navbar- disable “onClick” drop-down
- Some doubts about WordPress handle the horizontal main menu visualization
- How to conditionally add a wp_filter
- Remove/Hide a Widget on a Custom Template
- Does wordpress add their own classes into nav menus?
- Custom menu: Link names
- Parent/Child pages
- .current_page_ancestor broken in Twenty Eleven
- finding menu hierachy > wp_get_nav_menu_items
- How to substitute old wordpress menu by wp 3 menu the right way?
- Archives and Categories in Custom Menu
- Why nav_menu_css_class doesn’t work with apply_filters?
- Best way to give user the option to make a menu, mega menu?
- Programatically Created Menu not Editable in Dashboard
- 3 Level Menu Navigation (3rd Level not displaying)
- Theme: dropdown hover menu not showing up in IE/Edge
- Pages not displaying as sections on static page
- How can I show a custom WordPress menu anywhere I want on my website?
- Show all menu levels except top level. How to exclude top level of a menu?
- Menu is in Reversed order
- WordPress Menu item > Sub menu Class update
- How to know and change the machine name of a menu?
- Need help with adding custom wordpress menu and sub-menu
- WordPress menu walker – Get parent item text inside end_lvl function
- How to achieve this navigation style in wordpress navigation
- HTML TO WP Theme : Submenu goes down wp_nav_menu
- wp_nav_menu custom walker class
- Fallback dosen’t work when not using ‘menu’ attribute
- How to add custom nav_menu_css_class to certain menu only?
- WordPress doesn’t recognize submenus as so I can’t style them properly
- Primary Menu Showing All Pages With No Sub-Nav
- How to add drop symbol to parent nav items which have child
- After theme change the menus have to be manually linked to the corresponding theme location
- WordPress 3.9 two menus in same position?
- Horizontal Navigation
- What’s the policy for building a theme that doesn’t support widgets/menus?
- Problem with multiple menus in theme
- How can I change the title of the Home link in the navigation bar?
- Header links also appearing in the footer
- How to make navigation a list without a plugin? [duplicate]
- How to highlight current menu bar base on the URL?
- Global Navigation menu in diiferrent wordpress setups
- Add wrapper for a specific sub-menu