Add same filter for several carousels
-
Hello, and thanks a lot for your plugin!
I’m using it to display my projects, which are organized by category.
I have managed to customize one carousel using the add_filter code and got the result I’m looking for.
But my code targets only one carousel (by ID) and I need to use that same model for several carousels, one in each category page. Is this possible?
I’m not a programer, and I tried my best but I’m stuck right now.
And I’m french, so I hope I’m being clear in my request ??Any chance you could help?
Thank you so much for your response.Here is the code I use:
add_filter('dd_filter_owl_carousel_script', 'custom_owl_carousel_filter', 10, 2); function custom_owl_carousel_filter($owl_script, $carousel_id){ if ($carousel_id !== 762) return $owl_script; $owl_script =" jQuery(function($){ $('#carousel-762').owlCarousel({ 'autoWidth' :true, 'loop':true, 'autoplay' : false, 'autoplayTimeout' : 2000, 'smartSpeed' : 400, 'fluidSpeed' : 400, 'autoplaySpeed' : 400, 'navSpeed' : 400, 'dotsSpeed' : 400, 'margin': 400, 'autoplayHoverPause' : false, 'center' : false, 'responsiveRefreshRate' : 200, 'slideBy' : 1, 'mergeFit' : true, 'mouseDrag' : true, 'touchDrag' : true, 'nav' : false, 'navText' : ['',''], 'dots' : false, 'lazyLoad' : true, 'responsive':{ 0:{items:1}, 480:{items:1}, 768:{items:1}, 991:{items:1}, 1200:{items:1}, 1500:{items:1}, }, }); }); "; return $owl_script; }
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Add same filter for several carousels’ is closed to new replies.