How do I create a new WP admin color scheme?

This code works with WordPress 5.2 and is correct.

You now need to go to your Profile and select it by going to
Users > Your Profile > Admin Color Scheme
select the scheme and save.

enter image description here

Edit: Adding updated code for your colors CSS file since you’re using a child theme:

function additional_admin_color_schemes() {
    wp_admin_css_color( 'pro', __( 'Pro' ),
        get_stylesheet_directory_uri().'/wp-content/themes/astra-child/pro/colors.css',
        [ '#E5E5E5', '#E5E5E5', '#3498DB', '#3498DB' ]
    );
}
add_action( 'admin_init', 'additional_admin_color_schemes' );

Note here I removed the .min from the CSS file. I recommend you copy the non-minified CSS file over, so you can easily edit and customize the styles.

Leave a Comment