Archived topic
Mobile Off Canvas menu only on homepage
7 replies · Started by Simon on January 21, 2020
Hi guys, hope you are well and have had a good start to 2020!
Just wanted to know the best way to achieve the below:-
Mobile hamburger style menu on homepage only for desktop view (normal hamburger on mobile though).
I just want to show the menu on the homage here https://www.westcountrygames.co.uk/
Hope you can help.
Thanks
Simon
Hi there,
is this in place of the normal Navigation or as well as ?
Hi David
This will be the main source of navigation on desktop/tablet - only for the home page through. Navigation to be as it is currently on all the other pages.
Mobile will a normal hamburger menu - as present currently on all pages, including the homepage.
Hope this helps.
Simon
You can use the Menu Options filter to enable the off canvas on the Desktop for just the Front Page:
https://docs.generatepress.com/article/option_generate_menu_plus_settings/
the Off Canvas requires its own Menu Assigned to it.
Once thats done ill need to look at the site to provide some CSS to hide the standard navigation.
Hi guys,
I need the same functionality, can you help, please?
On desktop, the off-canvas menu needs to be only on homepage, while all other pages will use the regular menu.
All mobile will use the mobile off-canvas menu as well.
Two menus only, but desktop homepage needs to show the mobile one.
Help, please?
Hi there,
may be simpler to just force the Mobile Menu Breakpoint to a really high value using this php snippet:
add_filter( 'generate_mobile_menu_media_query', function( $width ) {
if ( is_front_page() ) {
$width = '(max-width: 10000px)';
}
return $width;
} );
https://docs.generatepress.com/article/generate_mobile_menu_media_query/
That did it!
Thanks!
You're welcome