Created
August 28, 2014 13:21
-
-
Save kneipp/525043c627f433cb1f9e to your computer and use it in GitHub Desktop.
adding custom style to wp-admin wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//http://wordpress.stackexchange.com/questions/110895/adding-custom-stylesheet-to-wp-admin | |
//from functions.php | |
//First solution : one file | |
add_action( 'admin_enqueue_scripts', 'load_admin_style' ); | |
function load_admin_style() { | |
wp_register_style( 'admin_css', get_template_directory_uri() . '/admin-style.css', false, '1.0.0' ); | |
//OR | |
wp_enqueue_style( 'admin_css', get_template_directory_uri() . '/admin-style.css', false, '1.0.0' ); | |
} | |
//Second solution : two or more files. | |
add_action( 'admin_enqueue_scripts', 'load_admin_styles' ); | |
function load_admin_styles() { | |
wp_enqueue_style( 'admin_css_foo', get_template_directory_uri() . '/admin-style-foo.css', false, '1.0.0' ); | |
wp_enqueue_style( 'admin_css_bar', get_template_directory_uri() . '/admin-style-bar.css', false, '1.0.0' ); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment