How to disable responsiveness in the admin theme of WordPress 3.8

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 ?
Stop Responsiveness WordPress 3.8
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.

  1. Create a plugin to add custom code.
  2. 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.
  3. De-register the default admin styling that comes with WordPress.
  4. 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. 🙂 🙂

Comments

4 responses to “How to disable responsiveness in the admin theme of WordPress 3.8”

  1. TN Avatar
    TN

    Great post, thank you! Would you be able to provide info on removing the “screen options” and “help” options from the admin toolbar area completely?

  2. Cornélio José Wiedemann Avatar

    responsive is my name. Not touch is my name! hehe
    just kidding

    i use you code. Tks

  3. leblanm Avatar
    leblanm

    Looks great but unfortunatly, it does not work at all for me. As if nothng changed. Maybe my theme has taken over. What do you think?

    1. Subharanjan Avatar

      This trick only works for the admin side of WordPress and this is something you can try, not sure if this conflicts with any plugins, themes etc. It works for me though.

Leave a Reply

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