Add Admin Style Sheet

This PHP code enables you to add CSS rules to a new style sheet named admin.css which should be placed in the root directory of your child themes folder.

Please copy ALL the code and paste it at the end of your child themes functions.php file using a text editor like Notepad++

add_action( 'admin_enqueue_scripts', 'enqueue_admin_style_sheet' );
function enqueue_admin_style_sheet() {

	wp_register_style( 'admin-css', get_stylesheet_directory_uri() . '/admin.css', false, '1.0.0' );
	wp_enqueue_style( 'admin-css' );

}

Adding CSS code to your main child themes style sheet will not work in your wp admin area.

Related Solutions

One response to “Add Admin Style Sheet”

  1. […] you want to add your own styling via your child theme, you will need to enqueue a admin style sheet and add your CSS rules to this admin.css file rather than your main child themes style […]

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.