Title: wp_enqueue_script() $ver parameter problem
Last modified: January 12, 2018

---

# wp_enqueue_script() $ver parameter problem

 *  Resolved [figure2](https://wordpress.org/support/users/figure2/)
 * (@figure2)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/wp_enqueue_script-ver-parameter-problem/)
 * Greetings. I am unable to provide a link since the site is being developed locally,
   so this will have to be a more general question.
 * I have successfully used the `wp_enqueue_script()` function call on many websites.
   However on one of my localhost sites, I encountered an issue with the `$ver` 
   parameter; specifically, including it causes the white screen of death. Removing
   it restores the website.
 * Example, this kills the website:
 *     ```
       function load_scripts() {
           // $ver parameter included
           wp_enqueue_script( 'my-script', get_template_directory_uri() . '/js/my-script.js', array( 'jquery' ), '1.0.0', true );
       }
       add_action( 'wp_enqueue_scripts', 'load_scripts' );
       ```
   
 * This restores the website:
 *     ```
       function load_scripts() {
           // $ver parameter removed
           wp_enqueue_script( 'my-script', get_template_directory_uri() . '/js/my-script.js', array( 'jquery' ), true );
       }
       add_action( 'wp_enqueue_scripts', 'load_scripts' );
       ```
   
 * What is my best strategy for tracking down the problem? The only plugins currently
   in the site are Akismet, Hello Dolly and a Portfolio custom post type that I 
   wrote. The last plugin is working fine and hasn’t caused any issues.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fwp_enqueue_script-ver-parameter-problem%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Thread Starter [figure2](https://wordpress.org/support/users/figure2/)
 * (@figure2)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/wp_enqueue_script-ver-parameter-problem/#post-9858782)
 * Sorry about the bad link. I accidentally added the post tags to the “The page
   I need help with” field.
 *  [RossMitchell](https://wordpress.org/support/users/rossmitchell/)
 * (@rossmitchell)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/wp_enqueue_script-ver-parameter-problem/#post-9858909)
 * Your usage looks good according to the docs here:
    [https://developer.wordpress.org/reference/functions/wp_enqueue_script/](https://developer.wordpress.org/reference/functions/wp_enqueue_script/)
   Suggest that you enable debugging by putting these into your wp-config.php file:
 *     ```
           error_reporting(E_ALL); ini_set('display_errors', 1);
           define( 'WP_DEBUG', true);
       ```
   
 * Be sure to remove these settings before going live.
 *  Thread Starter [figure2](https://wordpress.org/support/users/figure2/)
 * (@figure2)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/wp_enqueue_script-ver-parameter-problem/#post-9858976)
 * Thanks Ross, I give that a try.
 *  Thread Starter [figure2](https://wordpress.org/support/users/figure2/)
 * (@figure2)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/wp_enqueue_script-ver-parameter-problem/#post-9859211)
 * Missing quotes around the $ver parameter and missing “,” following it. Now I 
   feel stupid.
 * But it just goes to show when you are staring at this code for long enough these
   errors get sneaky and hide in plain sight.
 * Thanks for the troubleshooting tip.
 *  [RossMitchell](https://wordpress.org/support/users/rossmitchell/)
 * (@rossmitchell)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/wp_enqueue_script-ver-parameter-problem/#post-9859428)
 * I think I might have seen the missing ‘ and , BUT when I read the initial post
   I see them there. Did you post the code you were really using ? Confused.
 *  Thread Starter [figure2](https://wordpress.org/support/users/figure2/)
 * (@figure2)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/wp_enqueue_script-ver-parameter-problem/#post-9859447)
 * Actually no. I recreated it since the laptop the actual code was on was not powered
   up. Sorry for the confusion.

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

The topic ‘wp_enqueue_script() $ver parameter problem’ is closed to new replies.

## Tags

 * [white screen of death](https://wordpress.org/support/topic-tag/white-screen-of-death/)
 * [wp_enqueue_script](https://wordpress.org/support/topic-tag/wp_enqueue_script/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [figure2](https://wordpress.org/support/users/figure2/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/wp_enqueue_script-ver-parameter-problem/#post-9859447)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
