Title: Adding Javascript file to WordPress, how to register script
Last modified: August 21, 2016

---

# Adding Javascript file to WordPress, how to register script

 *  Resolved [jamo_dodger](https://wordpress.org/support/users/jamo_dodger/)
 * (@jamo_dodger)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/adding-javascript-file-to-wordpress-how-to-register-script/)
 * Hello, I am trying to add a JavaScript file to my WordPress site. The file is
   called social.js and contains all the scripts for my facebook, twitter etc buttons,
   and some JS for a floating menu that appears on scroll on the post pages.
 * I have uploaded the file to my parent themes js folder, but am not sure where
   to go from here.
 * Do i use `wp_register_script()`
 * Do I use `wp_enqueue_script()`
 * Do i use something like this:
 * `<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="
   text/javascript"></script>`
 * Should I combine all these JS files into one?
 *  I am using twenty twelve child theme.
 * Any advice would be greatly appreciated.
 * Thank you
 * James

Viewing 1 replies (of 1 total)

 *  Thread Starter [jamo_dodger](https://wordpress.org/support/users/jamo_dodger/)
 * (@jamo_dodger)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/adding-javascript-file-to-wordpress-how-to-register-script/#post-4690857)
 * Have asked question on stack overflow:
 * [http://stackoverflow.com/questions/22289806/adding-javascript-file-to-wordpress/22290313?noredirect=1#comment33876905_22290313](http://stackoverflow.com/questions/22289806/adding-javascript-file-to-wordpress/22290313?noredirect=1#comment33876905_22290313)

Viewing 1 replies (of 1 total)

The topic ‘Adding Javascript file to WordPress, how to register script’ is closed
to new replies.

## Tags

 * [add](https://wordpress.org/support/topic-tag/add/)
 * [enqueue](https://wordpress.org/support/topic-tag/enqueue/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [register](https://wordpress.org/support/topic-tag/register/)
 * [script](https://wordpress.org/support/topic-tag/script/)

 * 1 reply
 * 1 participant
 * Last reply from: [jamo_dodger](https://wordpress.org/support/users/jamo_dodger/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/adding-javascript-file-to-wordpress-how-to-register-script/#post-4690857)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
