Link to home
Start Free TrialLog in
Avatar of Chi Is Current
Chi Is CurrentFlag for United States of America

asked on

Hide "MENU" Button on Mobile Devices in WordPress

WP Twenty Twelve theme
https://SROTHAN.COM

When page displays on a mobile device, a "MENU" button appears behind pages' menu items.
When page displays on larger display (>800 x 600, for insance) "MENU" button does not appear.
How can this "MENU" button be hidden on mobile device displays so only menu items appear?

Many Thanks ~ Jacob
Avatar of Chris Jones
Chris Jones
Flag of United Kingdom of Great Britain and Northern Ireland image

You'll need to introduce @media queries for it.

Something like:

@media only screen 
    and (max-device-width: 640px), 
    only screen and (max-device-width: 667px), 
    only screen and (max-width: 480px)
{ 
.main-navigation ul.nav-menu.toggled-on, .menu-toggle {display: none;}
}

Open in new window


(This example deals with iPhone 6 and iPhone6+ you'll need to sort it for all the devices to which you wish to serve content.)

Check out this link for an excellent break down of available common media queries:
https://responsivedesign.is/develop/browser-feature-support/media-queries-for-common-device-breakpoints/
Avatar of Chi Is Current

ASKER

Chris ~  Thank you for your reply.  I find your recommendation DOES work to hide the "MENU" button on the iPhone I tried, but not on an Android (as you mentioned to be the case).
I did review the link you provided, and checked out their reference to "Why you don’t need device specific breakpoints" (https://responsivedesign.is/articles/why-you-dont-need-device-specific-breakpoints/)

I would like to provision this site to hide the "MENU" button on ALL DEVICES (as it does not appear on a desktop or laptop, for instance).

How can I hide the "MENU" button on ALL devices?

Thank you! ~  Jacob
ASKER CERTIFIED SOLUTION
Avatar of Chris Jones
Chris Jones
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Intended to close topic by accepting Chris's excellent suggestion above; inadvertently accepted my own remark....

Please advise.

C Wah!  That works beautifully, Chris!!!  I added your second suggestion:
.main-navigation ul.nav-menu.toggled-on, .menu-toggle {display: none !important;}

Open in new window

to the CHILD Theme (style.css), so, shouldn't create a problem.  It tests out perfectly on all devices I've checked.

Many Thanks! ~ Jacob
Great!!!!   Many Thanks ~ Jacob
You're welcome! As I said, typically it would be better to find the original css entries and edit those, but the !important feature does allow an override, just not the best practice. :)