• Resolved tiffdotc

    (@tiffdotc)


    Hi guys

    I’m working on a site that has the 1.1 version of the Twenty Twelve theme, and it isn’t working on mobile devices. It looks okay on iPads, but not on a phone. I took a look at the media queries, and tried changing a few things there, but nothing has fixed it. Do you have any ideas of what may cause mobile issues for the Twenty Twelve theme?

    The site is raisingdigitalnatives.com.

    Thanks in advance.

Viewing 15 replies - 1 through 15 (of 20 total)
  • I too am having a problem with the “menu button” that appears in place of the page navigation on both iPhone and Android devices. I deactivated all plugins to no avail. I have contacted the host provider and they claim using only simple host support with nothing special for mobile devices.

    Here’s the site: actannapolis.org

    The site is working well on iPad and other tablets. Just not phone devices.

    Also, my test site actannapolis.info does work correctly!

    Thanks so much for any pointers! –Richard

    @tiffdotc, exactly what features are not working correctly on a phone? One problem I see is that the desktop navigation bar doesn’t disappear, but it looks like it’s because the class for the nav bar was changed from main-navigation to home-navigation without corresponding changes to some CSS rules.

    Are you making changes directly to the theme’s files? You should note that changing a theme’s files is not advisable. If the theme gets updated because of feature enhancements, bug fixes, or security patches, then your changes will be lost. Instead, you should create a child theme.

    @actannapolis, your problems are similar, although you had the foresight to create a child theme. Some of the changes you made to your child theme’s header.php file are possibly the source of the problem. I see that the IDs of the menu containers were changed; did you also make the corresponding change to the JavaScript event trigger that toggles the menu?

    Thank you for your quick reply! I did not change any JavaScript…can you point me to some help to do this? –Richard (for actannapolis)

    I’ve created a child (of Twenty Twelve) theme for 8 or 9 websites and the navigation suddenly stopped working on the iPhone. “Menu” appears, nothing happens when you click on it. The navigation on all these sites worked until very recently. Any thoughts?

    Thread Starter tiffdotc

    (@tiffdotc)

    thanks CrouchingBruin. I figured out one issue is that the banner wasn’t re-sizing, so it pushed the body of the site over to the left of the screen (they assigned a class that doesn’t exist to the banner image). now that I’ve fixed that, the banner is re-sizing, but the site still has grey space on the right, and the banner is cut off at the top. the url again, if you want to check it out on a mobile device: raisingdigitalnatives.com.

    this is a site that another person developed, and i’m working on it now. i’m trying to figure out how everything was set up. CrouchingBruin, if you have any advice for how to fix the new issues, let me know.

    actannapolis and JonathanR62 – sorry guys, but can you please start your own thread? I don’t want to get email updates for issues that aren’t related to my original post. thanks.

    Most of the excess space is caused by this CSS rule:

    #FollowMeBubble{
       width:331px !important;
       position:absolute !important;
       left: 38% !important;
       top:200px !important;
       z-index:10000 !important;
       border-bottom:none !important;
    }

    Not sure why this rule is even needed because there’s an inline style which sets the visibility of #FollowMeBubble to hidden. However, to play it safe, if you just remove the left property from the above rule, that will eliminate most of the excess space without affecting the functionality of the tab.

    The rest of the excess space comes from the footer menu. For some reason, there’s inline styling which sets various properties of wp_footer_menu DIV, including setting the padding-left to 250px. Not only that, the properties are set using the !important clause. Two big no-no’s when it comes to web design is using inline styles and unnecessary use of the !important clause, because it makes it very difficult, and sometimes impossible, to override using CSS. Anyway, it’s the padding-left of 250px which is pushing the menu out to the right, causing the excess space on the right. You can see the footer menu looking kind of squashed to the right on a phone.

    So, what I would do is take the inline style out and move it into the stylesheet, removing the !important clauses. However, instead of carrying over the padding-left, I would set the margin-left & margin-right of the unordered list (and take the inline style out of the unordered list) to auto so the menu stays in the center:

    #wp_footer_menu {
       border: 1px solid #9db5cc;
       -webkit-border-radius: 10px;
       -moz-border-radius: 10px;
       border-radius: 10px;
       background-color: #909090;
    /* padding-left: 250px;  removed */
       padding-bottom: 25px;
       padding-top: 25px;
    }
    
    #wp_footer_menu ul {
       margin-left: auto;
       margin-right: auto;
       display: table;
    }

    For those of you who are having problems with the mobile menu, it looks like there’s a solution in this thread, but make sure you create a child theme first.

    Sorry to clutter up tiffdotc’s mail box, but have to thank you, CrouchingBruin for solving my problem! One line of code is all it took! Grateful!

    Thread Starter tiffdotc

    (@tiffdotc)

    that was so helpful – thanks so much. i updated the followmebubble, and that fixed the mobile view quite a bit. the only issue i have now is i can’t find where the wp_footer code is located.

    Try looking in the footer.php file. If you don’t find it there, I can suggest some CSS that you can add to that file that might override the inline style.

    Thread Starter tiffdotc

    (@tiffdotc)

    Yeah it’s not in the footer file. I also checked the plugin’s php files, and the index.php and page.php files. No luck! Not sure where else to look for it! If you have any css that would override it, I would really appreciate it. I need to see if my client would be up for scrapping this plugin – it hasn’t been updated in two years and it’s not very great.

    It turns out that inline !important rules cannot be overridden — grr! So you say that footer was created using a plugin? Do you happen to know which one?

    What you can do is hide that custom footer for cell phones using a media query in your CSS:

    @media screen and (max-width: 600px) {
       #wp_footer_menu {
          display: none;
       }
    }

    You should also add a display:none; to the #FollowMeBubble that was discussed in an earlier post. As I mentioned previously, the visibility is already set to hidden, but the element still takes up space. Setting the display to none will remove the space that it’s taking up.

    Thread Starter tiffdotc

    (@tiffdotc)

    Thanks so much – I removed the footer with the CSS you sent me, and that helped. As for the Follow Me, I added display: none; and it still showed up but when you clicked “follow me” on a mobile device, a shadow would appear for a pop-up box, but the pop-up box wouldn’t display. Luckily, I took a deeper look at the plugin and found that you could deactivate it for mobile devices, so I did that. The site looks *much* better on mobile now.

    Now just to tackle the menu… it’s a custom menu on the home page and it’s not super attractive! also working on moving custom CSS to a child theme like you suggested.

    thanks again for your help – i’m not sure i would have figured that all out on my own (or if i did, it would’ve taken me twice as long!).

    We use a twentytwelve child theme on our site and it too stopped working on mobile devices recently (within the past 2 weeks) (Menu button present but not working). I banged my head against the problem for a while and finally figured it out:

    We have a custom header.php that was a copy of the stock one with code added for our SSL certificate but with no changes to the navigation. We haven’t changed it in a while (sometime in June I think). Our header.php, and the original from twenty twelve until very recently used an <h3> tag for the Menu button. The newest version of the theme uses <button> instead. The code that updates the toggle is in navigation.js, which we did not touch in our child theme, but it too was updated to look for a button object instead of an <h3> like it used to.

    I figured it out by running the site in the Chrome debugger and saw navigation.js look for a button object that wasn’t there. I then checked the theme files and compared to a backup from July and discovered the change.

    Anyway, I fixed it by changing the <h3> to <button> in my child theme and everything works again.

    It appears that there was a theme update on or about 9/8/14 that introduced the problem. I will pay closer attention to theme updates from now on.

    Thread Starter tiffdotc

    (@tiffdotc)

    @collins that was a bit helpful – i played around with the inspect element on chrome (I usually use firefox) and realized I could inspect element as a mobile device.

    which leads me to the next battle – the home menu on a mobile device. the previous developer created a custom home menu that looks fine on a desktop, but takes up a ton of space and overrides the responsive menu on a mobile device. I’ve tried using the @media screen and (max-width: 600px) CSS that @crouchingbruin provided to override the home navigation, but it doesn’t work (unless I simply choose display: none;, and then no menu shows up on the homepage).

    So, the developer made a customer header_home.php file that i’m guessing is what won’t let me override the menu on mobile devices in the style.css file. i know nothing of php – could i add a media query to the php file to tell it to display the regular menu style rather than the custom one? Here’s the relevant code from the header_home.php file:

    <nav id=”site-navigation” class=”home-navigation” role=”navigation”>
    <h3 class=”menu-toggle”><?php _e( ‘Menu’, ‘twentytwelve’ ); ?></h3>
    “><?php _e( ‘Skip to content’, ‘twentytwelve’ ); ?>
    <?php wp_nav_menu( array( ‘theme_location’ => ‘primary’, ‘menu_class’ => ‘nav-menu’ ) ); ?>

    any advice would be appreciated with this. thanks!

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Mobile not working – twenty twelve theme’ is closed to new replies.