Title: Using Javascript Libraries &#8211; do I need to do something to include?
Last modified: August 20, 2016

---

# Using Javascript Libraries – do I need to do something to include?

 *  [vytaulla51](https://wordpress.org/support/users/vytaulla51/)
 * (@vytaulla51)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/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!!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/using-javascript-libraries-do-i-need-to-do-something-to-include/#post-2128017)
 * review:
 * [http://codex.wordpress.org/Using_Javascript](http://codex.wordpress.org/Using_Javascript)
 * [http://codex.wordpress.org/Function_Reference/wp_enqueue_script](http://codex.wordpress.org/Function_Reference/wp_enqueue_script)
 *  Thread Starter [vytaulla51](https://wordpress.org/support/users/vytaulla51/)
 * (@vytaulla51)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/using-javascript-libraries-do-i-need-to-do-something-to-include/#post-2128222)
 * Thank you for responding.
 * The links, though helpful, don’t answer my central question.
 * What I want to know is, do I HAVE to in some way “include” javascript/jquery 
   libraries just on principle? I guess I’m comparing this to sidebars: to widgetize
   sidebars you have to put code in the functions.php to “enable” them.
 * I’m understanding that, if I want to include some specific chunk of javascript
   on a page or post (that isn’t packaged as part of a plugin) I should include 
   it properly using the wp_enqueue script. But that refers to the specific, particular
   script, right?
 * That’s what I want to know. Do I need to add code somewhere to my theme so that
   plugins/widgets will work? Or do they all come with the code they need?
 * Or do they automatically access the libraries that “come” with WP?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Using Javascript Libraries – do I need to do something to include?’ is
closed to new replies.

## Tags

 * [jquery library](https://wordpress.org/support/topic-tag/jquery-library/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [vytaulla51](https://wordpress.org/support/users/vytaulla51/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/using-javascript-libraries-do-i-need-to-do-something-to-include/#post-2128222)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
