Skip to content

Instantly share code, notes, and snippets.

@crixlet
Created December 3, 2013 17:34
Show Gist options
  • Save crixlet/7773610 to your computer and use it in GitHub Desktop.
Save crixlet/7773610 to your computer and use it in GitHub Desktop.
proper way to add custom js
function wpb_adding_scripts() {
wp_register_script('custom_js', get_template_directory_uri() . '/js/func.js', array('jquery'), true);
wp_enqueue_script('custom_js');
}
add_action( 'wp_enqueue_scripts', 'wpb_adding_scripts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment