Skip to content

Instantly share code, notes, and snippets.

@norcross
Created August 23, 2012 16:21
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save norcross/3438225 to your computer and use it in GitHub Desktop.
Save norcross/3438225 to your computer and use it in GitHub Desktop.
using wp_enqueue_scripts and admin_enqueue_scripts
// front end
function custom_front_scripts() {
wp_enqueue_style( 'front-css', plugins_url('/lib/css/front-css.css', __FILE__), array(), null, 'all' );
wp_enqueue_script( 'front-init', plugins_url('/lib/js/front.init.js', __FILE__) , array('jquery'), null, true );
}
add_action('wp_enqueue_scripts', 'custom_front_scripts' );
// back end
function custom_admin_scripts() {
wp_enqueue_style( 'admin-css', plugins_url('/lib/css/admin.css', __FILE__), array(), null, 'all' );
wp_enqueue_script( 'admin-init', plugins_url('/lib/js/admin.init.js', __FILE__) , array('jquery'), null, true );
}
add_action('admin_enqueue_scripts', 'custom_admin_scripts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment