[BUG] Incompatible with Autoptimize
-
The plugin doesn’t work correctly when the site is optimized by Autoptimize (and probably other similar plugins…) which move jQuery around.
The issue is in wpb_shortcode.php, as the Javascript code generated by EDD Slider is run immediately rather than waiting for the document to load.
The solution is to embed the JS code in a $(document).ready (about line 162):
$output .= '<script type="text/javascript"> jQuery( document ).ready(function() { jQuery("#wpb_eps_'.$slider_id.'").owlCarousel({ autoPlay: '.$autoplay.', stopOnHover: '.$stop.', navigation: '.$nav.', navigationText: ["'.$prev.'","'.$next.'"], slideSpeed: '.$speed.', paginationSpeed: '.$paginationSpeed.', pagination: '.$pagination.', paginationNumbers: '.$count.', items : '.$items.', itemsDesktop : [1199,'.$items_desktop.'], itemsDesktopSmall : [979,'.$items_desktop_small.'], itemsTablet : [768,'.$items_tablet.'], itemsMobile : [479,'.$items_mobile.'], baseClass : "wpb-eps-carousel", }); }); </script>';
Maybe you want to implement this as standard…
— M.
- The topic ‘[BUG] Incompatible with Autoptimize’ is closed to new replies.