Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Owl Carousel Uncaught TypeError: undefined is not a function in Wordpress [duplicate]

I'm a developing own Wordpress theme. I'm using Owl Carousel

But getting this error Uncaught TypeError: undefined is not a function from 1st line and doesn't show any carousel item. Sorry my bad english.

$(document).ready(function() {

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

});
like image 361
Munkhbayar Yo Avatar asked Jun 01 '26 21:06

Munkhbayar Yo


1 Answers

jQuery is included with WordPress by default in no-conflict mode. In noConflict() mode, the 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
});
like image 89
rnevius Avatar answered Jun 04 '26 11:06

rnevius



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!