Archived topic
Different Menus on different pages
8 replies · Started by Dan on December 24, 2021
Hi there,
How can I setup different menus on different pages?
Ex. home page with Offcanvas and the rest with another type of menu.
Hi there,
try the option_generate_menu_plus_settings filter:
https://docs.generatepress.com/article/option_generate_menu_plus_settings/
For example, if you were to enable the Off Canvas Panel in the Customizer, then this snippet would disable that option everywhere apart from the Front Page:
add_filter( 'option_generate_menu_plus_settings','lh_custom_homepage_menu_plus_settings' );
function lh_custom_homepage_menu_plus_settings( $options ) {
if ( !is_front_page() ) {
$options['slideout_menu'] = 'false';
}
return $options;
}
Hi David,
It's little hard for me, but thank you for your quick feedback.
Blessing's
Hi there,
It's possible to setup all the pages to be in Offcanvas (Hamburger) menu permanent?
Do you want Pages to auto add to that menu? Ie. if you add a new page it automatically appear that ?
Hi David,
I want to use the Offcanvas menu (Hamburger) only for the entire site.
Aah ok.
So you would:
1. Set Customizer > Layout > Off Cavnas Panel to On.
2. Create your Menu with all the links you require and assign its Location to the Off Canvas Panel.
3. Create a new menu, name it blank or something and DO NOT add any links to it. Assign the Location to the Primary Navigation. This will remove the default menu that WP adds to the desktop navigation.
Thank you David,
Your feedback is helpfull.
You're welcome