Alas, this is a CSS issue, caused by some difference in WP’s classes applied. 🙂
First you are misinterpreting your “test” case 2:
- Dropdown isn’t highlighted because (despite what post body says) it’s not actually assigned the subcategory.
- The styling applied is from
.current-menu-parent
, since post is obviously not a term in taxonomy.
In your first case the class at work is .current-menu-item
, since we are looking at the term in taxonomy. Next the CSS rules .current-menu-item a
applies to all links inside of it and since dropdown HTML is inside top level item HTML it all gets styled as “current”.
You should be limiting such rules to immediately nested links inside container — .current-menu-item > a
(which is already done correctly for .current-menu-parent > a
).
Related Posts:
- How to move parent li to end of child ul
- How to apply a class to the second word in menu list item?
- Override custom menu widget
- Styling child custom menu pages
- When at / ( or “home”) my menu doesn’t get a current-menu-item class
- How do I prevent the text overflow in menu?
- How do i style the current menu anchor link’s parent anchor link? [closed]
- Custom Post type menu highlighted in the archive/post
- Vertical Sidebar Menu Parent and Child not displaying correctly [closed]
- How to insert custom code into wp_nav_menu structure?
- remove everything from wp_nav_menu
- Editing WordPress Nav Menu Walker
- Altering html structure and creating custom menus
- WordPress Admin Bar Covering & Overlapping Fixed Menu Header [closed]
- How to add class to and childs of sidebar widget – WordPress
- Add CSS to head depending on nav menu walker
- Grey out nav buttons unless is_user_logged_in()
- Add a class at specific element in custom Menu Walker
- CSS for Created Menu “Active Selected” not working, everything else is!
- How do I add (css) class to a custom link to make it current_page_item
- Side Menu Icon Expandable
- wp_nav_menu not working [closed]
- create a 2 row menu in wordpress
- Making nav menu sticky and transparent
- current-menu-item class in CSS
- Switch from hover to click on Twenty Twelve Menu
- How to style a specific nav menu item?
- How Do I Add Images To Main Navigation Menu
- Excluding a media query from specific pages
- How to I know the class or ID of my theme?
- My Temptation theme is showing two of the same menu at the top. How do I remove the one that the theme comes with? Please help! [closed]
- How to change the color of a menu item [closed]
- display menu as table layout
- Highlight parent if item from submenu is active
- styling wp_nav_menu – horizontal, sub-menu drop downs
- Menu Arrow for Child Element
- How to buid wordpress menu with auto width sub-menu items in dropdown menu without any items sharing one line [closed]
- Trouble hiding menu on single page
- change hover color of specific menu link [closed]
- How to add css to single navigation text? [closed]
- How do I change/remove styling (top border) on main menu for active page and hovering (Avada Theme)
- Hide pages from the main menu
- Drop Down menu expanded by default (on front page) [closed]
- Odd spacing in Navigation Bar [closed]
- How to manipulate attributes of url-less dropdown item in a the custom wordpress menu?
- Using CSS ID’s and Classes with images in a WordPress Horizontal Menu
- Is there any way to change the CSS class applied to 2nd level sub menu ul’s?
- Custom menu styling
- Determining the “current_page” in WordPress Custom Menus
- New wp menu menu styling
- Child pages don’t become submenus (as in the twenty-ten theme)?
- Secondary Menu Not Functioning as a Sticky Menu
- I’m trying to remove a duplicate menu, which only appears on the homepage?
- Making the menu toggled open on mobile devices Illustratr theme
- Im having trouble centering menu items in footer due to “flexbox”
- Menu items not clickable
- How to add CSS class to and and id in a nav menu with code?
- Change hover to onclick on menu
- wp_nav_menu container style args
- Stuck while adding bootstrap navwalker class
- How to swap text in menu item back and forth?
- Disable Top Nav Bar on Mobile
- How to get rid of the bottom line in the navigation menu via CSS file?
- Active Current Menu – Adding class to child theme
- Making my main menu a hamburger menu on all platforms
- WordPress menu issue after update
- Adding span to a particular text in an menu item
- Get Sub-Menu Dropdown to Show Over Page Content
- Problem with positioning of the menu in custom WP style
- How can I make menu items into two seperate buttons with different functions?
- Responsive Dropdown Menu
- Vertical Menu items shifting to same line when window size increased [closed]
- Active page link not getting class assigned
- Making a Custom Menu Sidebar Icon show as Current in css [closed]
- Help with changing style of the extended menu drop down [closed]
- How do i keep my current page menu highlighted on pagination?
- individual images as navigation design TwentyTen
- Styling Active Links Within WordPress
- Specifying Class style for Menu
- Bought custom navigation menu from codecanyon, how to change feature.php?
- Menu Underline shows without Hover after adding subitems
- Creating a Horizontal menu
- Any plugin to make a 3 levels menu? [closed]
- Problem with float:left – unexpected behavior [closed]
- wp nav menu – highlighting current page not working properly [closed]
- Why there is a gap between and it’s container (A drop down menu in wordpress) [closed]
- Changing color of specific tab of top menu
- Why is my hamburger menu not shown? [closed]
- How to centre menu items on horizontal nav bar? (e.g. make margins equal) [closed]
- How to change first letter of active menu item
- Site navigation sits unstyled for a second on page reload [closed]
- Formatting WordPress Menus (without bullets, inline with text)
- Changing when mobile menu is displayed
- Adding padding above menu
- how to add permalink/slug to wordpress custom link menu item
- Active Navigation Class Based on URL on icon
- Hiding Widget On Mobile Devices Removes Our Product Search Box On Mobiles
- change breakpoint widths for divi theme tablet view
- Rename Menu icon in Twenty seventeen theme
- Main Menu Hover is Always White