Is there a way to override the styles in the admin in my theme?

I don’t want to touch the admin style sheet if I don’t have to.

I just want to make a column bigger in my admin, but also, to do it in a way that doesn’t get overridden in a future wordpress update.

3 s
3

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 Reply

Your email address will not be published. Required fields are marked *