Skip to content

Instantly share code, notes, and snippets.

@joshcanhelp
Created August 12, 2014 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshcanhelp/fcf71710d2ee8a7274d4 to your computer and use it in GitHub Desktop.
Save joshcanhelp/fcf71710d2ee8a7274d4 to your computer and use it in GitHub Desktop.
/**
* CSS and JavaScript for admin pages
*/
function proper_admin_css_js() {
global $pagenow;
// CSS
wp_enqueue_style(
'proper-admin',
get_template_directory_uri() . '/assets/css/admin.css'
);
// JS
wp_enqueue_script(
'proper-admin',
get_template_directory_uri() . '/assets/js/admin.js',
array( 'wp-color-picker', 'jquery' ),
FALSE,
TRUE
);
if ( $pagenow == 'themes.php' && isset( $_GET['page'] ) && $_GET['page'] == 'theme-settings.php' ) {
wp_enqueue_style( 'wp-color-picker' );
}
}
add_action( 'admin_enqueue_scripts', 'proper_admin_css_js' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment