How to Change the Entire WordPress Admin panel Look and Feel?

Here’s a great codex article on the topic of creating administration theme: http://codex.wordpress.org/Creating_Admin_Themes

And back to your question, you will want to load different stylesheets for different user roles, so you have to check who the current user is. Pay attention, the check is done using current_user_can() function and checking for administrator is not being done via is_admin() ( that’s a check if you script is being loaded on administration side of your web, not for administrator ).

Slightly modified first code example of a codex

<?php
function my_admin_theme_style() {
    if ( current_user_can( 'manage_options' ) ) { //means it is an administrator
        $style="my-admin-theme-administrator.css";
    } else if ( current_user_can( 'edit_others_posts' ) ) { //editor
        $style="my-admin-theme-editor.css";
    } else if ( current_user_can( 'edit_published_posts' ) ) { //author
        $style="my-admin-theme-author.css";
    } else if ( current_user_can( 'edit_posts' ) ) { //contributor
        $style="my-admin-theme-contributor.css";
    } else { //anyone else - means subscriber
        $style="my-admin-theme-subscriber.css";
    }
    wp_enqueue_style('my-admin-theme', plugins_url($style, __FILE__));
}
add_action('admin_enqueue_scripts', 'my_admin_theme_style');

function my_admin_theme_login_style() {
    //we can't differentiate unlogged users theme so we are falling back to subscriber
    $style="my-admin-theme-subscriber.css";
    wp_enqueue_style('my-admin-theme', plugins_url($style, __FILE__));
}
add_action('login_enqueue_scripts', 'my_admin_theme_login_style');

Also, see Roles and capabilities page for getting an idea on how you can differentiate user roles.

Cheers!

Leave a Comment