Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

WordPress Customizing the WordPress Admin Area Admin Color Schemes Customizing Admin Color Schemes from Scratch

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,028 Points

Treehouse Palette doesn't show up in the admin area.

Hello all. :)

This is a tricky one.

The Treehouse palette isn't showing up when I add the code to the Admin panel.

I'm pretty sure my code and file structure is correct.

I've correctly... I think linked up the child theme. My theme is called wpthemecustomizer and the child is wpthemecustomizer-child.

child-theme (d)
    functions.php
    style.css
    admin-colors (d)
            treehouse (d) - a folder for a new palette of admin colours 
               colors.css

And here's my code in my child theme functions.php file.

function _wpt_admin_color_schemes() {

      $theme_directory = get_stylesheet_directory_uri();

      wp_admin_css_color(

         'treehouse', __('Treehouse'),
         //use concatenation to build the path to the CSS file that adds controlls the view of the palette. 
          $theme_directory . '/admin-colors/treehouse/colors.css',     
         //contains an array og hexadecimal codes to display on Admin area as list of colours
         array('#384047', '#5bc67b', '#838cc7','#ffffff')
      );

}

add_action('admin_init', 'wpt_admin_color_schemes');

Help! :)

2 Answers

Lee Adamson
Lee Adamson
9,347 Points

Hi

I experienced the same issue, after a bit of googling I found this answer which works

function new_color_scheme() {

wp_admin_css_color(
    'new', __( 'NEW' ),
    get_stylesheet_directory_uri() . '/admin-colors/new/colors.css',
    array( '#0051ba', '#f9d616', '#F50057', '#FF4081' )
    );
}

add_action( 'admin_init', 'new_color_scheme');
Bradley Maravalli
Bradley Maravalli
8,927 Points

Had the same issue. Make sure you have the Twenty Fourteen Child Theme activated.