How to disable responsiveness in the admin theme of WordPress 3.8 ? How do I disable responsiveness of WP 3.8 admin ? Is there any way to disable responsiveness ? I want to disable the responsive hiding feature for tablets and mobile for the newly introduced WordPress 3.8 admin back end.
The question comes, Why do you need to disable the responsiveness ? So, here is a problem/situation that describes WHY ?
Problem/Situation:
I just updated my WordPress setup to WP 3.8 and most of my custom functionality are either inaccessible or very hard to manage on mobile devices. There are some things which doesn’t even get displayed on mobile devices. Earlier, I was able to manage my site’s functionality from backend on a mobile device too. Even though it was not responsive and not so cool. The problem is that I have installed some custom made plugins which were made keeping an eye on the old style admin theme and it provides me some custom made interface on the admin side. Obviously these were not made responsive. Now, with this new WordPress admin theme, all those custom interfaces are completely messed up. So I have two options:
- Either revert back to WP 3.6/3.7 ( but I really like the look and feel of the new WP 3.8 theme yet I don’t need the responsive property 🙁 )
- Or make changes to all the custom made screens/interfaces in the admin side to be responsive. ( I can do that, but it would take much time to accomplish. Also, does it worth doing just for the sake of a new responsive admin theme in mobile devices ? 😕 )
How can I keep the new, super cool, awesome theme of WordPress 3.8 yet disable responsiveness of the theme ? ❓ ❓ ❓
Solution:
I tried to search for any solution but didn’t find any. Here is a quick solution that I have done to get back my custom functionality in the admin screen.
- Create a plugin to add custom code.
- Take the css file that is responsible for the wp-admin side styling and responsiveness. Make changes to remove the responsive property out of it. Basically remove all the media queries written for mobile devices.
- De-register the default admin styling that comes with WordPress.
- Register and enqueue the changed css file again to apply the custom styling.
Download the code as a plugin: disable-responsive-admin
Code for disabling responsiveness:
/* De-register the default admin style */ function subh_remove_admin_styles() { wp_deregister_style( 'wp-admin' ); } add_action( 'admin_init', 'subh_remove_admin_styles' ); /* Register the customized admin css for WordPress 3.8 */ function subh_register_custom_wp_admin_style() { /* Register our stylesheet. */ wp_register_style( 'wp-admin', plugin_dir_url( __FILE__ ) . '/wp-admin.css', array( 'open-sans', 'dashicons' ) ); } add_action( 'admin_init', 'subh_register_custom_wp_admin_style' ); /* Load the custom css as a replacement to the admin stylesheet */ function subh_load_custom_wp_admin_style() { wp_enqueue_style( 'wp-admin' ); } add_action( 'admin_enqueue_scripts', 'subh_load_custom_wp_admin_style' );
Download the above code as a plugin: Plugin to disable responsiveness in WP 3.8 admin
Note: This never a proper/good way of doing changes to admin styling. Still, as I have upgraded and would like to keep the theme and remove responsiveness, I am using the above quick solution. If you are facing the same problem as I am, use the above procedure or download and install the plugin. You can modify the css file present inside the plugin directory too. Caution: Use with your own risk. 🙂 🙂
Leave a Reply