• Resolved ilia.di

    (@iliadi)


    Twenty Sixteen MENU does not work on mobile. On desktop it is showing pages menu, but on mobile only a button, which does not work when pressed. I am new to WordPress. Please help.

Viewing 15 replies - 1 through 15 (of 17 total)
  • I had a similar experience when I upgraded from the twentytwelve theme.

    My problem was caused by my taking a “short cut” and copying over the contents of my twentytwelve-child into a new twentysixteen-child. The problem resolved itself when I deleted the header.php and all code referencing the selectnav function in twentytwelve (this is in style.css and the js folder) from twentysixteen-child.

    There’s probably a lesson here: If you change theme always start with a clean child-theme.

    Needless to say, I now need to check the twentysixteen features before I reapply my custom code to avoid duplication.

    PS I also saw that in mobile mode, the menu appears automatically at the bottom of the page. Probably a neat idea but I’ll need some ‘phone time trying it out.

    My menu also does not work on mobile but works fine on desktop. Any help would be much appreciated. My website is https://www.trybackyardfarming.com

    It has taken me an age to get twentysixteen to work as I think it should – far too much white space and I’m still not there. I think its the theme’s media queries screwing my css.

    Anyway, I can say that the Menu button works ok if I’m on an actual iPad or iPhone, but if I just shrink the browser window is sometimes fails (again I suspect the media queries).

    I had been using the plugin “Sticky Menu (or Anything!) on Scroll” – this works fine except (as the plugin descripes) it would not support the Menu button when scrolled. I have now fixed title and menu is my child css.

    I believe there is a bug. T his is all the css I use for the Menu button, some is just a styling choice:

    /*  Menu button & menu on small screens */
    .main-navigation li {        /* needed to fix bug on Menu's dropdown being transparent */
        background-color: white;
        z-index: 2000;
    }
    .menu-toggle {margin: 7px 0;}    /* position button  */
    button {text-transform: none;  border-radius: 5px;}
    .site-header-menu {
        background:white;
    }
    .menu-item a {padding-left: 8px;}

    Thread Starter ilia.di

    (@iliadi)

    I am VERY sorry! I must admit:

    I mislead the whole group here. I have just discovered that ALL WAS MY FAULT.

    I assumed that MENU is not controlled by… Theme Footer (footer.php), which I touched. The MENU button works just fine.

    Sorry to you all – affected in the forum and the Twenty Sixteen Developers.

    For what it’s worth, although I didn’t fix the root cause ( and don’t really care), I got mine to start working again by using the plug-in: jQuery Responsive Select Menu. After messing around with all sorts of things, all I had to do with this was install and activate it and it instantly fixed the issue (made the mobile menu button work). Thank you weird little plug-in, I can now go back to my life. https://www.trybackyardfarming.com

    I checked out trybackyardfarming.com, and the mobile menu still wasn’t working so I’m assuming this has not yet been fully resolved.

    My website is https://www.davidpereira.ca, and I’m having a challenging time figuring out how to get the menu to work in mobile/ reduced window size mode.

    I searched elsewhere online, and found issues with the following code, but I’m pretty sure I’ve fixed all of mine. Here it is again anyway:

    ‘<?php if ( has_nav_menu( ‘primary’ ) || has_nav_menu( ‘social’ ) ) : ?>
    <button id=”menu-toggle” class=”menu-toggle”><?php _e( ‘Menu’, ‘twentysixteen’ ); ?></button>

    <div id=”site-header-menu” class=”site-header-menu”>
    <?php if ( has_nav_menu( ‘primary’ ) ) : ?>’

    Anonymous User 8052865

    (@anonymized-8052865)

    Outside of the OP’s mistake, this is still an issue that I can’t fix, even with the jQuery Responsive Select Menu.

    Any ideas???

    The reason to move to 2016 was a good, functional mobile layout….

    what is the deal????
    I am using 2016, with a child theme, tested on ios9.2, safari and chrome….

    OK well I’m back. Jquery Responsive Select menu worked for me until the newest WordPress update and now it does not work at all. daveychills: where would I put that code you suggested?

    Hi jdavis7330. Regrettably, the closest fix that I found does not resolve this issue either. I found that fix on the following site:
    https://flexer.ca/wordpress-twentytwelve-theme-mobile-menu-working-update/
    I’ve read elsewhere that the problem may related to conflicts with a plugin, though I haven’t found anything to say that definitively. I’m still looking for a solution…. anybody?… please help restore my faith in a mobile WordPress future!

    Just in case it is a plugin conflict, I can confirm that the Mobile menu in twentysixteen theme is working with these plugins:

    All-in-One event calendar
    amr shortcode any widget
    contact form builder
    custom bulk/quick edit
    custom content shortcake
    data tables generator by supsystic
    duplicator
    easy table
    enhanced media library
    google analytics by toast
    meta slide
    mobile gallery
    RSS featured images
    WP fontallic easypromoweb

    Hope that helps …

    I just built a site using Twentysixteen child theme and in the process also broke and subsequently fixed the menu on mobile. Here is what I had to fix:

    1. The header.php code cannot be rearranged, the menu and menu buttons have to stay inside #masthead. I did end up rearranging it, and then loading my custom version of functions.js using functions.php (see code below)

    2. twentysixteen/js/functions.js must be included because it gives the menu its mobile functionality.

    I quickly checked trybackyardfarming.com and looked for the code in functions.js, and its seems like it might be missing. It was tricky since that site has the JS files combined.

    Here is my functions.php if that helps anyone:

    <?php
    /**
     * Child theme functions.php
     */
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
    	// adds parent & child style.css files
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array('parent-style')
        );
        // adds child functions.js file and screenReaderText
        wp_enqueue_script( 'twentysixteen-child-script', get_stylesheet_directory_uri() . '/js/functions.js', array( 'jquery' ), '20160203', true );
        wp_localize_script( 'twentysixteen-child-script', 'screenReaderText', array(
    		'expand'   => __( 'expand child menu', 'twentysixteen-child' ),
    		'collapse' => __( 'collapse child menu', 'twentysixteen-child' ),
    	) );
    
    }
    
    add_action( 'wp_print_scripts', 'theme_dequeue_scripts' );
    function theme_dequeue_scripts() {
    	// remove parent functions.js file and screenReaderText
        wp_dequeue_script( 'twentysixteen-script' );
        wp_deregister_script( 'twentysixteen-script' );
    }

    Hope this helps someone!

    classicridge: Thank you so much. I’m going to explore this approach

    Well, still no luck. Still looking for help

    Can you disable the plugin that is caching and combining the JS files? Is it W3 Total Cache?

    I disabled it, but not sure where to go from there

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Twenty Sixteen MENU does not work on mobile’ is closed to new replies.