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

I am trying to change the WordPress Admin panel look and feel for depending upon the different role types that are in WordPress. How can create/assign different themes for each role i.e.

  • Editor > Admin Panel Theme 1
  • Author > Admin Panel Theme 2
  • Contributor > Admin Panel Theme 3
  • Subscriber > Admin Panel Theme 4

or even for the website Administrator also.

what i am looking for is to change the WordPress admin panel html structure/layout, User Interface.

Are there any hooks or action available, please guide.

Regards,

1
1

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