Skip to content

Instantly share code, notes, and snippets.

@jpen365
Last active August 25, 2016 22:54
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 jpen365/3814f67e02ddd6abd8bd5fdd001d1f23 to your computer and use it in GitHub Desktop.
Save jpen365/3814f67e02ddd6abd8bd5fdd001d1f23 to your computer and use it in GitHub Desktop.
Enqueue a CSS and JS file as part of a plugin.
function custom_css_js_enqueue_scripts() {
/* enqueue the custom-style.css file */
wp_enqueue_style( 'custom-css', plugins_url( '/css/custom-style.css', __FILE__ ), $ver = false );
/* enqueue the custom-scripts.js file */
wp_enqueue_script( 'custom-js', plugins_url( '/js/custom-scripts.js', __FILE__ ), $deps = array( 'jquery' ), $ver = false, $in_footer = true );
}
add_action( 'wp_enqueue_scripts', 'custom_css_js_enqueue_scripts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment