Title: where to place javascript code in wordpress
Last modified: August 30, 2016

---

# where to place javascript code in wordpress

 *  [sunnydeville](https://wordpress.org/support/users/sunnydeville/)
 * (@sunnydeville)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/where-to-place-javascript-code-in-wordpress/)
 * can someone please tell me where to put this code in my wordpress editor where
   it says javascript i have no ideal where to place it ive tried in the php and
   css and i get a error

Viewing 1 replies (of 1 total)

 *  [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * (@lorro)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/where-to-place-javascript-code-in-wordpress/#post-6872270)
 * There are different ways but this should work. Put your script in /uploads and
   use this code in functions.php for your child theme:
 *     ```
       <?php
       add_action( 'wp_enqueue_scripts', 'add_my_script' );
       function add_my_script() {
         wp_enqueue_script( 'my-js', '/wp-content/uploads/my_script.js', array(), "1", true);
       }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘where to place javascript code in wordpress’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/where-to-place-javascript-code-in-wordpress/#post-6872270)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
