I'm just wondering what is the correct way to do it? Add it in via the theme header? If so, what is the proper way to do it? I see a lot of the other current stuff in there using the bloginfo() function.
Thank You!
|
I'm just wondering what is the correct way to do it? Add it in via the theme header? If so, what is the proper way to do it? I see a lot of the other current stuff in there using the bloginfo() function. Thank You! |
|||
|
|
|
You could tack it into header.php as you suggested (although this is not really the proper way to do it, it is best to use WPs enqueue function as described here). When do you need these? All the time? You can enqueue scripts and styles to be used all the time, or on an as-needed/per template basis http://codex.wordpress.org/Function_Reference/wp_enqueue_script |
|||||||||||
|
|
the right way would be using wp_enqueue_script for scripts and wp_enqueue_style for styles. |
|||
|
|
|
Scribu has an excellent article on loading scripts in WordPress. Basically, if you need a script to load on every page, use the following code (blatantly copied from said article):
(I removed the part of that snippet that expresses a dependency on jQuery). I suggest you read that whole post - it's very educational. |
|||
|
|