WordPress 3.8 Admin Colour Selection

15
Dec

WordPress 3.8 Colour Schemes

WordPress 3.8 brings a new styled administration backend. Making it responsive and with a selection of 6 colour schemes. The previous version only had two colors, blue or grey.

Users can easily select or change which colour scheme they want by going to their user profile and making the change.

Regular WordPress users can stop reading here, however if you are a WordPress developer looking for a way to set the default scheme to match your own branding or any other reason, please read on.

The default color scheme is black, grey, blue, but for our sites, we wanted our default scheme for new users to be ‘Midnight’, black, grey, blue red so we could differentiate the full back end from the colour scheme we use for the Easy Blogging Plugin (from WPMU DEV) that we provide on our sites.

To do this you need to set the user meta option when a new user is created.

Add the following bit of code to your functions.php (changing the scheme name as required)

[code]

add_action( 'user_register', function($userid) {
update_user_option( $userid, 'admin_color', 'midnight');
});

[/code]

If you are doing this on a WordPress multi-site, there is an additional parameter required at the end of  the call to update_user_option  and you probably want to create a mini plugin or add it to other multi site code you already have in your own ‘plugin’

e.g.

[code]

<?php
/*
Plugin Name: do-special-stuff

Plugin URI: http://multisite.locally.uk
Description: Does extra stuff for my multisite
Version: 0.1
Author: Locally
Author URI: http://multisite.locally.uk
*/

/* ----   set default admin colour scheme for new users--- */

add_action( 'user_register', function($userid) {
update_user_option( $userid, 'admin_color', 'midnight', true );
});

/* --- end  admin colours --- *

?>

[/code]

Comments

  • Rob
    December 19, 2013

    Thanks for the article. I can’t believe on WP 3.8 none of the colour options included the old colour scheme which people are used to and is far easier on the eye in my opinion. WP needs to learn if it ain’t broke don’t fix it!

  • llocally
    December 19, 2013

    The ‘light’ setting isn’t too dissimilar, we’ve also just come across an admin colour plugin with more options, although haven’t played with it yet. – http://wordpress.org/plugins/admin-color-schemes/

    Mark

Leave A Reply

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