- This topic has 11 replies, 2 voices, and was last updated 4 years, 4 months ago by
Tom.
-
AuthorPosts
-
October 5, 2016 at 1:09 pm #232567
Justin
Hello,
I have the primary menu set up as follows:
Assume the Main menu option is Cars
Under Cars, we would have Sedans and All cars
Sedans is a one-time post we want to link to
All cars is a category with all posts about cars/sedans
Problem: While on the sedans post, the menu item for All cars will not highlight when you hover over it.
Is this normal WordPress behavior? Is there a possible fix?
October 5, 2016 at 3:15 pm #232590Tom
Lead DeveloperLead DeveloperSo the hover color isn’t working for that menu item?
This happens when the menu item is set to current. The current menu item has no hover.
Of course, you can overwrite this with CSS:
.main-navigation .main-nav ul .current-menu-item > a:hover { background: red; color: #FFFFFF; } .main-navigation .main-nav ul ul .current-menu-item > a:hover, .main-navigation .main-nav ul ul .current-menu-parent > a:hover { background: red; color: #FFFFFF; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 5, 2016 at 9:04 pm #232635Justin
Correct – the hover color isn’t working on the sub-menu items when on that item’s page. Same thing when hovering over that sub-menu item’s category page which is also an item in the menu.
I’m not sure that CSS code worked for me. Is that intended to create a background hover color for sub-menu items in the primary menu?
October 5, 2016 at 10:51 pm #232655Tom
Lead DeveloperLead DeveloperIt should make it so the item hovers to that color regardless of where it is as long as it’s a current menu item.
Can you link me to the page with that CSS added?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 6, 2016 at 1:40 pm #232952Justin
When on this page:
http://thegreencarguy.com/plug-in-vehicle-charging-need-know/Try hovering over Fuels > all articles
October 6, 2016 at 1:59 pm #232960Tom
Lead DeveloperLead DeveloperI just adjusted the CSS above to include CSS for the sub-menu as well.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 6, 2016 at 2:08 pm #232962Justin
Thanks Tom. That seems to highlight the sub-menu item for that article’s link, but it’s still not highlighting the last link in that sub menu for all articles about charging.
October 6, 2016 at 2:10 pm #232964Tom
Lead DeveloperLead DeveloperI’m not seeing the second piece of CSS I added above added?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 6, 2016 at 2:36 pm #232972Justin
I have the below CSS added in both appearance > simple css and under simple css for the specific post.
.main-navigation .main-nav ul .current-menu-item > a:hover {
background: red;
color: #FFFFFF;
}.main-navigation .main-nav ul ul .current-menu-item > a:hover {
background: red;
color: #FFFFFF;
}October 6, 2016 at 10:52 pm #233059Tom
Lead DeveloperLead DeveloperJust made another adjustment to the CSS.
Let me know π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 7, 2016 at 8:26 am #233201Justin
Thank you, Tom! That works perfectly. You’re the best.
October 7, 2016 at 8:58 am #233218Tom
Lead DeveloperLead DeveloperYou’re welcome! π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.