Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1398519

    Hi!
    Is there a way to keep the Desktop version as it is but change the location of menus on mobile version: to locate the Top menu (Secondary) on Main menu area and to move the Top menu (secondary) to burger menu area?
    Thank you!

    #1398530

    Hey easybusyweb,
    Not as you have described, but you can go to Enfold Theme Options ▸ Main Menu ▸ Alternate Menu For Mobile and use a different menu for mobile devices.

    Best regards,
    Mike

    #1398542

    Thank you very much for your quick response! In that case, is there a way to style the top menu to fit in one row when it turns to mobile? It looks good on Desktop, but on Mobile it turns to 3 lines of text.

    #1398544

    Hi,
    Please link to your site so we can see, I assume that it becomes 3 lines because it won’t all fit in one line?

    Best regards,
    Mike

    #1398546

    Yes, correct. Here is the link: https://easybusy.net/

    Thank you!

    That’s why I got the idea to make the top menu the main menu for mobile and the main menu to put in the top bar.

    • This reply was modified 1 year, 8 months ago by easybusyweb.
    #1398552

    Hi,
    Thanks for the feedback, try going to your menus and hovering over the “Delete Menu” link for your main menu and your topbar menu so that at the bottom of the page your browser will show you the link address, in the link address look for menu=xx the xx will be a number, in this screenshot the number is 11
    Enfold_Support_424.jpeg
    Ok, so now you have both numbers, for this example let’s say 37 for the one you want to be the mobile topbar menu & 11 for the one you want to be the new mobile main burger menu.
    Now add this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    function custom_top_nav_menu( $args = '' ) {
    if($args['theme_location'] === 'avia2')
    if ( wp_is_mobile() ) {
    $args['menu'] = '37';
    }
    return $args;
    }
    function custom_main_nav_menu( $args = '' ) {
    if($args['theme_location'] === 'avia')
    if ( wp_is_mobile() ) {
    $args['menu'] = '11';
    }
    return $args;
    }
    add_filter( 'wp_nav_menu_args', 'custom_main_nav_menu' );
    add_filter( 'wp_nav_menu_args', 'custom_top_nav_menu' );

    Adjusting the numbers to suit.
    Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.
    If you have trouble please include an admin login in the Private Content area so we can assist.
    If you get an error from WordPress that you can’t add the code to your child theme functions.php then try doing so via FTP or your cPanel file manager.

    Best regards,
    Mike

    #1398560

    Hi Mike,
    thank you so much!

    I tried it and the site went a little crazy :)

    I’ll send you the admin login in the private section.

    Thank you!

    Dijana

    #1398564

    Hi,
    Thanks for the login, this is what I added to your child theme functions.php:

    
    function custom_top_nav_menu( $args = '' ) {
    if($args['theme_location'] === 'avia2')
    if ( wp_is_mobile() ) {
    $args['menu'] = '28';
    }
    return $args;
    }
    function custom_main_nav_menu( $args = '' ) {
    if($args['theme_location'] === 'avia')
    if ( wp_is_mobile() ) {
    $args['menu'] = '7';
    }
    return $args;
    }
    add_filter( 'wp_nav_menu_args', 'custom_main_nav_menu' );
    add_filter( 'wp_nav_menu_args', 'custom_top_nav_menu' );

    In my test the topbar menu and the main burger menu switched for mobile, I tested on an Android device.
    Please note that if you test on a desktop browser you will need to reload the page for it to work.

    Best regards,
    Mike

    #1398587

    Thank you so much! You are amazing! This is exactly what I wanted!

    The top bar is still in 2 lines, but it’s better than three :)

    Thank you!

    #1398607

    Hi,
    Glad we were able to help, Try making the text of the menu items smaller so they will fit on one line. If you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Change menus on mobile’ is closed to new replies.