WordPress.org

Ready to get started?Download WordPress

Forums

How to change Dashboard Colors on Multisite under 3.8 (8 posts)

  1. jimmarks
    Member
    Posted 7 months ago #

    With the update to 3.8, WP updated the dashboard colors to a black background. We have 500 sites on a Multisite install and really dont want to change the background color (we were using light grey) in each, individually.

    Is there a way to change the colors themes for all?

  2. http://halfelf.org/2013/mp6uccess-tips-and-tricks/

    See "Force a Choice"

    Everyone's using ecto on my network :D

  3. jimmarks
    Member
    Posted 7 months ago #

    This plugin says "Do not use with WordPress 3.8 or Higher" Anyone else have a suggestions?

  4. What ... plugin? MP6?

    No no no. See "Force a Choice"

    add_filter('get_user_option_admin_color', 'change_admin_color');
    function change_admin_color($result) {
        return 'ectoplasm';
    }

    You DO NOT need to add a plugin. I'll edit the post to make that clear, but I promise, this works on core WP. Well... not the ectoplasm stuff. You need http://wordpress.org/plugins/admin-color-schemes/ for those colors.

  5. jimmarks
    Member
    Posted 7 months ago #

    Thanks! Still a little techie for me... we have 6 different themes on the network... Would I need to add this code to each theme? and can you tell me where? Thanks for the help.

  6. Hi Jim,

    No, you do not need to add the code to every theme on the network -- that'd be a lot of work in some cases :)

    Here's how to set the default color for the entire network.

    (1) With SFTP / FTP / SSH etc, go to /wp-contents/. Create a new folder called "mu-plugins." Plugins in this folder will be activated by default on all sites within the network.

    (2) Create a single php file and call it whatever you want. Something like admin-color.php.

    (3) Input the code below, customize to your color choice:

    <?php
    /**
    Plugin Name: Admin-Color
    */
    
    add_filter('get_user_option_admin_color', 'change_admin_color');
    function change_admin_color($result) {
        return 'ectoplasm';
    }

    (4) Log into your Network and the color will be set, woot woot!!

  7. LABCAT
    Member
    Posted 2 months ago #

    Hi there,

    This code works excellent. However I wondering if it is possible to do this but then still allow users to change the admin theme?

    Currently the user can change the admin theme but it reverts back to the default theme set by change_admin_color as soon as they visit another page in the admin area.

  8. add_filter( 'get_user_option_admin_color', function( $color_scheme ) {
    
    	global $_wp_admin_css_colors;
    
    	if ( ! isset( $_wp_admin_css_colors[ $color_scheme ] ) ) {
    		$color_scheme = 'ectoplasm';
    	}
    
    	return $color_scheme;
    
    }, 5 );

Reply

You must log in to post.

About this Topic

Tags

No tags yet.