Remove mobile layout option

If you find this tweak helpful:

Beginners

Tweaking Elegant Themes involves creating a child theme and editing PHP and CSS files within a text editor. If you have never done this you may want to read our guide on creating a child theme. All tweaks are written with the assumption that you have a default installation of your theme.  Any tweaks or changes you may have previously made to your theme could affect the outcome of the tweaks on this site. All tweaks should be tested before applying to a live site. 

 

Some themes give you the option to disable responsive layout in the epanel. Foxy does not have this option. You can use the following tweak to disable it manually. 

PHP

Create an empty php file in the folder  /themes/foxy-child/

Name it functions.php if it doesn't already exist

Add this code:

<?php

function remove_action_mobile() {
remove_action( 'wp_head', 'et_add_viewport_meta');
}

add_action('init','remove_action_mobile');

?>

Save the file and refresh your site on a mobile device. It should now have the same layout as your desktop version.

Post a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest

Share This