• One given slider loads in A product category, but doesn’t in B product category.

    In B the the following code is missing:

    <script type='text/javascript'>
    	jQuery(document).ready(function() {
    		jQuery('#slider_1177').owlCarousel({
    			items : 1,
    			smartSpeed : 200,
    			autoplay : true,
    			autoplayTimeout : 30000,
    			smartSpeed : 200,
    			fluidSpeed : 200,
    			autoplaySpeed : 200,
    			navSpeed : 200,
    			dotsSpeed : 200,
    			loop : true,
    			autoplayHoverPause : true,
    			nav : true,
    			navText : ['',''],
    			dots : false,
    			responsiveRefreshRate : 200,
    			mergeFit : true,
    			mouseDrag : true,
    			touchDrag : true
    		});
    	});
    </script>

    Also in B, might be related to the follwing code being in the body as opposed to the head:

    <script type='text/javascript' src='/wp-includes/js/jquery/jquery.js?ver=1.12.4'></script>
    
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author simonpedge

    (@simonpedge)

    You did give both sliders different CSS IDs?

    Thread Starter cpucpu

    (@cpucpu)

    It’s the same slider shown in different product categoeries.

    Plugin Author simonpedge

    (@simonpedge)

    JQuery should be pre-loaded in the head, otherwise you could have issues. Owl Carousel and Owl Carousel require jQuery in order to run, and if jQuery is being loaded AFTER my plugin tries to generate its JavaScript code there will be a problem.

    Thread Starter cpucpu

    (@cpucpu)

    So, the <script> tag that initilizes the slider isn’t embeded into the <body> because jquery isn’t into the <head>. Because some owl carrousel issue… What issue could that be?

    I already tricked WP to load jquery into the head. The body is still prefered though.

    • This reply was modified 7 years, 2 months ago by cpucpu.
    • This reply was modified 7 years, 2 months ago by cpucpu.
    • This reply was modified 7 years, 2 months ago by cpucpu.
    • This reply was modified 7 years, 2 months ago by cpucpu.
    Plugin Author simonpedge

    (@simonpedge)

    jQuery comes bundled with WordPress, and the ‘Correct’ way for your WordPress theme to load it is by having the following code in your theme’s ‘functions.php’ file:

    function theme_scripts() {
    wp_enqueue_script(‘jquery’);
    }
    add_action(‘wp_enqueue_scripts’, ‘theme_scripts’);

    So try modifying your (child) theme’s ‘functions.php’ file, adding this code. Always and only use the version of jQuery bundled with WordPress. Do not use a custom version – otherwise you may get compatibility issues.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Slider disappeared (duplicate?)’ is closed to new replies.