How do I stop a widget from displaying on mobile site?
Add a class .hide with property display: none; – specify only for mobile viewports, not in desktop styles assign the class to your widget or to the entire sidebar, as needed
Add a class .hide with property display: none; – specify only for mobile viewports, not in desktop styles assign the class to your widget or to the entire sidebar, as needed
I had exactly the same problem. In the base TwentyTwelve theme there has been a code change so that the site navigation changed from h3 to button. You need to update header.php file in the child theme to use <button class=”menu-toggle”><?php _e( ‘Menu’, ‘twentytwelve’ ); ?></button> See WordPress TRAC #28824 comment 13 The problem occurs … Read more
wp_is_mobile() this function is for code the device on which you viewing site is mobile. i mean this condition will true if you view site in mobile. now as per your question you want to display slider and sidebar only in desktop then your code will be like below: 1. for sidebar if (!wp_is_mobile() ) … Read more
You can do this via css by pushing the first element of the second menu over, and then position:absolute your logo e.g. (not tested) #element li:nth-child(4) { margin-left:300px; } #logo { position:absolute; left:500px top:50px; } Change the pixels to your desired lengths This can also be done with jQuery append e.g. $( “#element li:nth-child(3)” ).append( … Read more
Mobile menu works on local XAMPP, but not on GoDaddy [closed]
We might need more details, but I’m going to assume that you are using subdomains, and that you want to retain the site’s subdomain name on the new server. If that’s the case, then all you should need to do is export the site, then import it on the new server. Then set up a … Read more
Wouldn’t it be enough to switch mobile/desktop via a $_SESSION variable, make the “switch to desktop link” include something like ?switchtodesktop=1 and have the header contain something like session_start(); if ($_GET[‘switchtodesktop’]) { $_SESSION[‘switchtodesktop’] = true; } $desktop = isset($_SESSION[‘switchtodesktop’]); […] if ($desktop) { // only desktop css without media queries } else { // default … Read more
This is more of a php question than a WP question, but there’s a great function here that does what you’re looking for. function is_mobile() { // Get the user agent $user_agent = $_SERVER[‘HTTP_USER_AGENT’]; // Create an array of known mobile user agents // This list is from the 21 October 2010 WURFL File. // … Read more
Given that this is an older question and the mention plugin is very much depreciated, both the WordPress core and themes have changed greatly since then. Nowadays, most themes are mobile-friendly and will conform based on the amount of screen space is being used to visit a website.
The default WordPress themes, from Twenty Eleven onwards, support varying degrees of responsive design, including menus, and any child themes will automatically inherit this behaviour, unless the child theme does something to override it. It is possible to create menus in your theme using wp_nav_menu that can then be hidden or displayed for various screen … Read more