How to hide custom sidebar on mobile
You don’t provide lots of details on your code. Something like this should work: @media only screen and (max-width: 599px) { #sidebar-left { display: none; } }
You don’t provide lots of details on your code. Something like this should work: @media only screen and (max-width: 599px) { #sidebar-left { display: none; } }
Disable the plugin at all and in your function.php add add_action(‘init’, ‘my_mobile_redirect’); function get_first_url_subdir() { return str_replace( str_replace( array(‘http://’, ‘https://’), ”, get_site_url() ), ”, $_SERVER[‘SERVER_NAME’] . $_SERVER[‘REQUEST_URI’]); } function redirect_mobile_with_cookie() { $cookiename=”redirect_mobile_is_a_mobile_device”; if ( isset($_COOKIE[$cookiename]) && ($_COOKIE[$cookiename] == ‘yes’) && strpos(get_first_url_subdir(), ‘/mobile’) !== 0) return true; return false; } function my_mobile_redirect(){ if ( redirect_mobile_with_cookie() ) … Read more
You can change the options siteurl and home. add_action(‘after_setup_theme’, ‘maybe_mobile_url’); function maybe_mobile_url() { if ( wp_is_mobile() ) { add_filter(‘option_siteurl’, ‘add_mobile_url’ ); add_filter(‘option_home’, ‘add_mobile_url’ ); } } function add_mobile_url ($url) { return $url . ‘/mobile’; } But, I think, that if you define WP_SITEURL and/or WP_HOME in config.php it will fail, and you will have to … Read more
Found the solution… the problem was due to placement of the conditional statement in the wp-config.php file. It needed to be inserted before the require_once(ABSPATH . ‘wp-settings.php’); line near the bottom of the default config file, otherwise the constants are already defined and cannot be redefined. So final section of the wp-config.php file now looks … Read more
After investigation and talking with some sysadmin friends, it happened that there was a .htaccess with rewrite rules for mobile devices in the root of WordPress, in wp-content and in all folders in themes and plugins. I removed all the .htaccess, refresh the root .htaccess with only wordpress needed stuff and everything is good now. … Read more
There isn’t an is_mobile() function to my knowledge. WordPress uses a wp_is_mobile() which is probably what you’re looking for. So it should look like this: <?php if ( wp_is_mobile() ) { wp_nav_menu( array(‘menu’ => ‘mobile’ ) ); } else { wp_nav_menu( array(‘menu’ => ‘primary’ ) ); }; ?> EDIT After reviewing your question further it … Read more
It’s doable with a user agent string “sniffer”. Take a look at this project: http://mobiledetect.net Mind you, this approach can be troublesome as most modern browsers can ‘fake’ their user agent strings. Also, this approach doesn’t work to well with caching systems. I’ve implemented it successfully on a project I worked on, and I know … Read more
The safest way to manage content from outside of the WordPress dashboard, and make use of the WordPress roles and capabilities model, is via XML-RPC. The basic methods built in to WordPress XML-RPC allow you to add, edit and delete posts and media, and restrict the ability to do so based on WordPress user permissions. … Read more
You can easily do this using HTML and CSS. You can write 2 blocks of div for the same image and toogle display:none; properties in CSS using media queries as shown below. Note: I have remove the “a href” tag for mobile. <!–HTML Start –> <div class=”image-grid desktop”> <a href=”#”><img src=”#” /></a> <div> <!–For Mobile … Read more
It sounds like a ‘classic rollover effect bug’ to me: if you trigger a visual effect on any link (or ‘button’) either with jQuery or JavaScript, users on touch devices may be forced to click twice: “iPad/iPhone hover problem causes the user to double click a link“ I suggest you either try to replace the … Read more