Title: Which file to add code to load javascript
Last modified: August 19, 2016

---

# Which file to add code to load javascript

 *  Resolved [imjscn](https://wordpress.org/support/users/imjscn/)
 * (@imjscn)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/which-file-to-add-code-to-load-javascript/)
 * I want to add an external javascript. WP documents said I either need to add 
   code in header.php or add code in functions.php.
    I find out I have header.php
   in each of the 2 themes that comes with WP, but in the theme that I currently
   use, there’s no header.php.
 * So, now I try the 2nd method, to add code in functions.php, but I find that beside
   one in includes folder, each theme folder has one functions.php.
 * Which functions.php is the file I should add the javascript code?
 * Thanks for helping!

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

 *  [Samuel B](https://wordpress.org/support/users/samboll/)
 * (@samboll)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/which-file-to-add-code-to-load-javascript/#post-1446855)
 * the theme’s `functions.php`
 *  Thread Starter [imjscn](https://wordpress.org/support/users/imjscn/)
 * (@imjscn)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/which-file-to-add-code-to-load-javascript/#post-1446858)
 * Thanks!

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

The topic ‘Which file to add code to load javascript’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [imjscn](https://wordpress.org/support/users/imjscn/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/which-file-to-add-code-to-load-javascript/#post-1446858)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
