Auto play owl carousel in wordpress

i have a owl carousel in a “ThemeForest” wordpress template.
in this theme, a carousel is used, but it’s not playing automatic. how can i make it like that ?

Did you research carousel plugins for WordPress before you chose the owl carousel? Because from what I can see (after only glancing at the Owl Carousel website, it looks like it was meant to be touch-activated, and there are many slideshow plugins for WordPress that all work automatically.

Actually, I took a closer look at the Owl Carousel, and there is an option for autoplay. You should take a good look at the website demos then come back if you have further questions.

2 Likes

i looked into the demos and i found the demo i needed .
but in the javascript file of the wordpress, when i change the autoplay value to 1, it does not change anything ! this is the part of js file i edited and its connected to the owl carousel :
libs.js (52.2 KB)

Read the instructions and sample code in the demo. I think you should be setting autoplay to true, not to 1. The default value is false.

1 Like

i changed that value to true but nothing happend.
even when i target it with this code:

var owl = documnet.getElementsByClassName('owl-carousel');
owl.owlCarousel({
    loop:true,
    autoplay:true,
    autoplayTimeout:1000,
    autoplayHoverPause:true
});

I’ve formatted your code to make it easier to read. You can do that by placing three backticks (`) on the line before the code and then three more backticks on the line after the code.

If you copied and pasted the exact code that you used, there is a typo in the first line: documnet instead of document. Could that be the problem?

No i made that Correct, But i Got This Error In My Console:

Uncaught TypeError: Cannot read property ‘owlCarousel’ of undefined

In This Line :
owl[0].owlCarousel({

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.