Title: Trouble using wp_enqueue_script
Last modified: August 19, 2016

---

# Trouble using wp_enqueue_script

 *  [appsformacs](https://wordpress.org/support/users/appsformacs/)
 * (@appsformacs)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/trouble-using-wp_enqueue_script/)
 * Hey guys,
 * I’m having a lot of trouble using the wp_enqueue_script.
 * I’m trying to call in a JavaScript i made using php, because it seems to be conflicting
   with the slider on my site. This is the code i thought would work. Why doesn’t
   it?
 * > <?php wp_enqueue_script(‘$src’, ‘wp-content/themes/creativepress/js/thing.js’?
   > >
 * Thanks for your help
 * -Sam

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

 *  [Mark Ratledge](https://wordpress.org/support/users/songdogtech/)
 * (@songdogtech)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/trouble-using-wp_enqueue_script/#post-1285440)
 * Might be that `$` in the name of your script. [WordPress : Using Javascript libraries with your plugin or theme ](http://www.lost-in-code.com/platforms/wordpress/wordpress-using-javascript-libraries-with-your-plugin-or-theme/)
 *  Thread Starter [appsformacs](https://wordpress.org/support/users/appsformacs/)
 * (@appsformacs)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/trouble-using-wp_enqueue_script/#post-1285441)
 * Please reply. Lately people haven’t bothered with a reply to any of my posts,
   i’ve searched the forums and found no one with a similar problem.
 *  Thread Starter [appsformacs](https://wordpress.org/support/users/appsformacs/)
 * (@appsformacs)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/trouble-using-wp_enqueue_script/#post-1285442)
 * I did that and got the error
 * Parse error: syntax error, unexpected ‘;’ in /home/appsfor1/public_html/test/
   wp-content/themes/creativepress/slide.php on line 2
 *  [Mark Ratledge](https://wordpress.org/support/users/songdogtech/)
 * (@songdogtech)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/trouble-using-wp_enqueue_script/#post-1285443)
 * Patience.
 * Read the error; that’s a problem in your theme.
 *  Thread Starter [appsformacs](https://wordpress.org/support/users/appsformacs/)
 * (@appsformacs)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/trouble-using-wp_enqueue_script/#post-1285444)
 * There is no ;
 * Thats my problem 🙂
 * This is the code:
 * > <?php wp_enqueue_script(‘thing’, ‘wp-content/themes/creativepress/js/thing.
   > js’?>
 *  Thread Starter [appsformacs](https://wordpress.org/support/users/appsformacs/)
 * (@appsformacs)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/trouble-using-wp_enqueue_script/#post-1285445)
 * Gragghhh 🙁
 *  Thread Starter [appsformacs](https://wordpress.org/support/users/appsformacs/)
 * (@appsformacs)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/trouble-using-wp_enqueue_script/#post-1285447)
 * Someone help!
 *  [anexis](https://wordpress.org/support/users/anexis/)
 * (@anexis)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/trouble-using-wp_enqueue_script/#post-1285738)
 * trie adding a bracket and a ‘;’ at the end of this thingy:
 * >  This is the code:
   >  `<?php wp_enqueue_script('thing', 'wp-content/themes/creativepress/
   > js/thing.js'?>`
 * Instead place this:
    `<?php wp_enqueue_script('thing', 'wp-content/themes/creativepress/
   js/thing.js'); ?>`
 *  [hsatterwhite](https://wordpress.org/support/users/hsatterwhite/)
 * (@hsatterwhite)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/trouble-using-wp_enqueue_script/#post-1285759)
 * @appsformcs and [@songdogtech](https://wordpress.org/support/users/songdogtech/):
 * [@anexis](https://wordpress.org/support/users/anexis/) nailed it. In the original
   snippet of appsformacs’ code he’s missing a closing parenthesis and semicolon
   just before `?>`
 * This makes it seem like it’s a theme error only because that particular instance
   isn’t parsing correctly in slide.php

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

The topic ‘Trouble using wp_enqueue_script’ is closed to new replies.

 * 9 replies
 * 4 participants
 * Last reply from: [hsatterwhite](https://wordpress.org/support/users/hsatterwhite/)
 * Last activity: [16 years, 4 months ago](https://wordpress.org/support/topic/trouble-using-wp_enqueue_script/#post-1285759)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
