Enqueue scripts not working
-
For awhile, I’ve been loading my scripts through the header.php file. I wanted to get with WordPress conventions and load all my scripts through the functions.php file instead.
So I moved everything over to my functions.php file. I registered and enqueued a few styles and they work fine. I did the same with a few custom scripts and none of them work. They all work when placed back into the header.php file.
It looks like the .js file is being loaded, but it throws up an error:
Uncaught TypeError: undefined is not a function
That points to the 11th line of that specific JS file which has this in it:
jQuery('#desk1').powerTip({ manual: true });Each of these JS files starts with:
jQuery(document).ready(function(){I looked and jquery.js is only being loaded once. Judging by the console, jQuery is loaded first before any of the other javascript files.
As I mentioned earlier, these scripts all work just fine on the test site while they are called from the header.php file. Once I moved them into the functions.php file, they stopped working. Any help would be greatly appreciated!
The topic ‘Enqueue scripts not working’ is closed to new replies.