Owl Carousel Unfinished TypeError: undefined is not a function in Wordpress

I am developing my own Wordpress theme. I am using Owl Carousel

But getting this error Uncaught TypeError: undefined is not a function

from the 1st line and not showing the carousel. Sorry my bad english.

$(document).ready(function() {

    $("#owl-demo").owlCarousel();

});

      

+3


source to share


1 answer


jQuery is enabled by default in WordPress in no conflict mode . In mode, the noConflict()

global shortcut $

for jQuery is not available, so you need to use:



jQuery(document).ready(function($) {
    // Inside of this function, $() will work as an alias for jQuery()
    // and other libraries also using $ will not be accessible under this shortcut
});

      

+12


source







All Articles