Archived topic
Multiple Custom Menus
9 replies · Started by Andy on September 1, 2015
Hi,
I need to add a different custom menu to the left sidebar of 2 or more different pages. Is this possible?
Thanks.
A plugin like this may do the trick: https://wordpress.org/plugins/menu-swapper/
Thanks for the suggestion I looked into this but it only replaces the primary menu with a custom menu, you cant do the same in a sidebar.
I'm happy to register new sidebars and menus but I'm not sure how to do this with your theme as it doesnt use different page templates.
Any further help appreciated.
You could add the menu widget to the sidebar, set the default to hidden, then display it on specific pages. Something like this using css:
/* default hide sidebar menu */
#left-sidebar #nav_menu-2 {
display: none;
}
/* display sidebar menu on specific pages */
.page-id-2 #left-sidebar #nav_menu-2 {
display: block;
}
Adding CSS: https://generatepress.com/knowledgebase/adding-css/
Thanks, but I need two different custom menu sidebars, unless I misunderstaad your solution.
Add both menu widgets to the sidebar. Set them both to display:none. Then display either one or the other on specific pages as needed. Does that help?
Thanks I think this is going to work, I may also be able to use the Category widget instead of Custom menu.
Glad I could help. Let us know if you have any additional questions.
If you're using widgets you can use a plugin like this: https://wordpress.org/plugins/display-widgets/
Well, that's even better. No additional css :)
