Customize WordPress Admin Styles from Your Theme Directory

romeo

Newbie
Messages
28
Likes
1
Points
3
It’s better to style the /wp-admin of WordPress from your theme because it’s portable and upgrade-proof. Keeping all customizations  in ONE place is always a good idea in web development.

How to style WordPress admin backend /wp-admin from your theme?

1. Add this hook to the functions.php of your theme:

Code:
function customAdmin() {
    ?><link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/wp-admin.css" /><?php
}
add_action('admin_head', 'customAdmin');

Which effectively adds a stylesheet to the header of every /wp-admin page.

2. Create a text file named wp-admin.css in your theme directory.

3. Write the customization styles in wp-admin.css.

That’s it. Now you can freely customize the look and appearance of the WordPress admin backend from within wp-admin.css in your theme directory.
 

Members online