Loading jQuery correctly causes JS issues
-
Hello everyone,
I recently discovered that I should be using jQuery that comes pre-installed with WordPress as opposed to linking to an included one in my theme using this code:
<?php add_action( 'wp_enqueue_script', 'load_jquery' ); function load_jquery() { wp_enqueue_script( 'jquery' ); } ?>
The problem is I get the following error message with a slider that I’m using
undefined is not a function (evaluating '$('.slider').unslider()')
.
Here is my JS code:jQuery(function($) { $(function() { $('.slider').unslider(); }); });
Any help would be appreciated! PS: I’m not very good with JS/jQuery so please explain things clearly.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Loading jQuery correctly causes JS issues’ is closed to new replies.