Site logo

Archived topic

Both Primary and Off Canvas Menus on Mobile

3 replies · Started by Darryl on August 9, 2021

Viewing posts 1–4 of 4

I would like to use the primary menu as my regular website navigation and use the off canvas menu for my members only navigation, which will have additional links that are only for members.
On desktop it works just fine, but on mobile, the only menu that's displayed is the off canvas menu.
Is there any way to have both on mobile?

Hi Darryl,

Assuming a logged in user is automatically a member, you can try enabling the off-canvas menu by default but disable it for non-logged in users by using this PHP snippet.

add_filter( 'option_generate_menu_plus_settings','lh_custom_homepage_menu_plus_settings' );
function lh_custom_homepage_menu_plus_settings( $options ) {
	if( !is_user_logged_in() ){
        $options['slideout_menu'] = 'false';
	}
    
    return $options;
}

Here's how to add PHP - https://docs.generatepress.com/article/adding-php/

that code removes the member/off canvas menu for people that aren't logged in, which is great, but my initial issue was with the primary menu not displaying on mobile when the off canvas menu is enabled.

Hi Darryl,

Is there any way to have both on mobile?

Have you tried setting the Mobile Menu Breakpoint to 0 at customizer > layout > primary navigation?

Let me know :)

This archived topic is closed to new replies.