Using Javascript Libraries – do I need to do something to include?
-
Hi:
My understanding is that WordPress “includes” or comes with several javascript libraries.
When I create my own themes, do I need to do something to “enable” them? Or are they automatically included?
In the book “Beginning WordPress 3.0” the author provides some code to “add the built-in JQuery and UI core libraries to your theme” but she doesn’t say where to put it. In the header.php? In the functions.php? (I’m guessing the header.php.)
I checked the twentyten header and functions and don’t find any similar code in those.Her code is:
<?php function add_jquery() {
wp_enqueue_script('jquery');
wp_enqueue_script(jquery-ui-core');
}
add_action('wp_head', 'add_jquery');
?>I haven’t done anything to add libraries to sites I’ve built with my own themes so far and plugins work, etc.
What’s the deal with this?
Thanks!!
- The topic ‘Using Javascript Libraries – do I need to do something to include?’ is closed to new replies.