Title: Add some JavaScript files
Last modified: August 20, 2016

---

# Add some JavaScript files

 *  [tmette](https://wordpress.org/support/users/tmette/)
 * (@tmette)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/add-some-javascript-files/)
 * So I’ve enabled the Google Libraries plugin to help with calling in jQuery, but
   now I want to upload some JS files that depend on the jQuery library. I created
   a new folder in the _/wp-content/themes_ folder called _scripts_ and uploaded
   the two files there.
 * Now I have no idea how to properly load them. I want to use them on the entire
   WP site. I checked the _functions.php_ file for my specific theme to check and
   see if the Google Libraries plugin was using the _wp\_enque\_script_, but couldn’t
   find anything. Any help would be greatly appreciated!

Viewing 1 replies (of 1 total)

 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [14 years, 5 months ago](https://wordpress.org/support/topic/add-some-javascript-files/#post-2458465)
 * For `wp_enqueue_script` this may work in your `functions.php` file:
 *     ```
       add_action('wp_enqueue_scripts', 'theme_enqueue_scripts');
       function theme_enqueue_scripts() {
           wp_enqueue_script( 'your-script', get_site_url() . '/wp-content/themes/script/your-script.js', array('jquery') );
       }
       ```
   
 * It would be cleaner IMHO if you put that script in the same theme directory as
   your `functions.php` file and replace the `wp_enqueue_script` line with
 *     ```
       wp_enqueue_script( 'your-script', get_template_directory_uri() . '/script/your-script.js', array('jquery') );
       ```
   
 * Read more [here](http://codex.wordpress.org/Function_Reference/wp_enqueue_script).
 * It’s not my code, I lifted it from some other code I’m admiring for my child 
   theme. 🙂

Viewing 1 replies (of 1 total)

The topic ‘Add some JavaScript files’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * Last activity: [14 years, 5 months ago](https://wordpress.org/support/topic/add-some-javascript-files/#post-2458465)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
