WordPress admin stylesheet

Take a look here at the CODEX for an example on how to do this very thing.

Example: Load CSS File on All Admin Pages

function load_custom_wp_admin_style(){
    wp_register_style( 'custom_wp_admin_css', get_bloginfo('stylesheet_directory') . '/admin-style.css', false, '1.0.0' );
    wp_enqueue_style( 'custom_wp_admin_css' );
}
add_action('admin_enqueue_scripts', 'load_custom_wp_admin_style');

Example: Target a Specific Admin Page

function my_enqueue($hook) {
    if( 'edit.php' != $hook )
    return;
    wp_enqueue_script( 'my_custom_script', plugins_url('/myscript.js', __FILE__) );
}
add_action( 'admin_enqueue_scripts', 'my_enqueue' );

Leave a Comment