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


Comments

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 […]

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.