What is the correct way to reference Javascript?
-
I am currently using WP 3.5 and created a child theme from the twetytwelve theme. I have been using wp_head() to put the scripts in the <head> section of my child theme. the functions look something like this:
function carrousel_script(){ echo '<script type="text/javascript" src="'.get_template_directory_uri().'/js/jquery.jcarousel.pack.js"></script>'; } add_action('wp_head', 'carrousel_script');
I know there is a better way to do this and I’d like to know it. The codex talks about wp_enqueue_script(‘custom-script’) – I am a little confused there. Also, notice I am just using jquery scripts so nothing custom, nothing fancy. Thanks in advance for the help!!..
my site: Visual Upload
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘What is the correct way to reference Javascript?’ is closed to new replies.