Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #833799

    Hi there

    Since the last update our mobile menu shows all the items from our desktop AND mobile website. I did everything written in here: http://kriesi.at/documentation/enfold/hide-menu-itemselements-on-mobile/

    Can you help me?

    Thanks and regards,
    Simon

    #834780

    Hey Simon,

    Currently custom CSS classes are stripped out of menu items on mobile. We will fix it in upcoming Enfold update. In the meantime, you can try creating a new menu for mobile version and add following code to Functions.php file in Appearance > Editor and display different menu on mobile

    function av_different_mobile_menu( $args = '' ) {
    	if($args['menu_id'] == 'avia-menu') {
    		if(wp_is_mobile()) {
    			$args['menu'] = 'main-menu-mobile';
    		} else {
    			$args['menu'] = 'main-menu';
    		}
    	}
    	return $args;
    }
    add_filter( 'wp_nav_menu_args', 'av_different_mobile_menu' );

    Please make sure to replace menu names (“main-menu” and “main-menu-mobile”) in the code to match the name of your menus

    Best regards,
    Yigit

    #837047

    It worked, thanks!

    Regards,
    Simon

    #837418

    Hi Simon,

    Glad it worked for you! :)

    We will keep the thread open and will wait to hear from the creator of this thread. If you have any other questions or issues, please feel free to start a new thread.

    Best regards,
    Victoria

    #839148

    Hi Victoria

    I just realized, it doesn’t work anymore. I did the following steps:

    1. Appearance > Menu: I created two seperated menus, linked them to the desktop and the mobile sections and named them (main-menu & main-menu-mobile)

    2. Appearance > Editor: I added the following code:

    `function av_different_mobile_menu( $args = ” ) {
    if($args[‘menu_id’] == ‘avia-menu’) {
    if(wp_is_mobile()) {
    $args[‘menu’] = ‘main-menu-mobile’;
    } else {
    $args[‘menu’] = ‘main-menu’;
    }
    }
    return $args;
    }
    add_filter( ‘wp_nav_menu_args’, ‘av_different_mobile_menu’ );

    Did I miss something?

    Thanks for your help!
    Simon

    #839194

    Hi Simon,

    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?

    Best regards,
    Victoria

    #839205
    This reply has been marked as private.
    #840759

    Hi,

    This is working fine on our installation. Please note that it’s not going to switch if you’re just resizing the browser. You have to refresh the page or check the menu on an actual mobile device.

    Best regards,
    Ismael

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.