Archived topic
Navigation Menu Widget Current Item Background
3 replies · Started by Anthony on February 26, 2020
Inside the customizer you can set the current menu item background, link color, hover color etc.
I want to achieve this with a menu that just placed on a page using a Navigation Widget. Is this doable?
Here's the page: https://www.cukebook.org/tools/nutrition/legumes/
The <li> list is the one that I'm referring to. As you can see above that list I'm using basic HTML buttons to achieve this but I have to edit each page individually.
I can handle the css to get the menu inline and looking correct I just can't figure out how to get the "Current" page menu item to be highlighted when you're on that page.
Right now there's
- Fruits and Vegetables
- Nuts and Seeds
- Legumes
Thanks
Hi there,
any reason why you can't use the Secondary Navigation ?
https://docs.generatepress.com/article/secondary-navigation-layout-overview/
You can add this PHP Snippet to place it below the Header Element:
add_action( 'after_setup_theme','lh_move_secondary_navigation' );
function lh_move_secondary_navigation() {
remove_action( 'generate_after_header', 'generate_add_secondary_navigation_after_header', 7 );
add_action( 'generate_after_header', 'generate_add_secondary_navigation_after_header', 15 );
}
I guess my concern is that it's not really a secondary menu I'm trying to use it for. It's a one-off menu that's never going to appear anywhere else on the website ever.
I may reserve my secondary menu for something that may be more sitewide.
That being said, I am going to use your solution with the secondary menu for the time being!
Thanks
No problems - let us know if you change your mind.