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 to see the link]
- The topic ‘wp_enqueue_script() $ver parameter problem’ is closed to new replies.