WordPress.org

Ready to get started?Download WordPress

Forums

Leaf
[resolved] Slider JS not working. (6 posts)

  1. estebanglas
    Member
    Posted 1 year ago #

    For whatever reason the slider on my site is not working as intended. It displays the titles and captions as a list, but no images or animation.

    I have set featured images for all and I have tried changing the slider from all categories to single categories with no success.

    I wonder if there is some conflicting JS with one of the installed plugins.

    I have read the theme's fórum and didn't find an answer to this (I've seen people having issues with the slider for other reasons, like not setting a featured image).

    The URL for the website: http://redtacora.com.ar

  2. bradthomas127
    Member
    Theme Author

    Posted 1 year ago #

    @estebanglas - Have not seen this happen before, for some reason it is not loading the iView slider JS or CSS.

    Try resetting Leaf options and clearing your cache if using a cache plugin and if that don't work try switching themes and deleting Leaf and then re-installing it.

  3. estebanglas
    Member
    Posted 1 year ago #

    Dang! I hate to be the special case! ;-)

  4. estebanglas
    Member
    Posted 1 year ago #

    On theme-functions.php I commented the condition to load the CSS and JavaScript:

    // if ( is_front_page() ) {
    		wp_enqueue_style( 'ivew-slider-css', get_template_directory_uri() . '/js/iView/css/iview.css', array(), '0', 'all' );
    		wp_enqueue_script( 'ivew-slider-js', get_template_directory_uri() . '/js/iView/iview.min.js', array( 'jquery' ), '0', true );
    		wp_enqueue_script( 'jquery-easing', get_template_directory_uri() . '/js/iView/jquery.easing.js', array( 'jquery' ), '0', true );
    	// }

    Now CSS and JS loaded so I changed the Rule:

    if ( is_home() || is_front_page() ) {
    		wp_enqueue_style( 'ivew-slider-css', get_template_directory_uri() . '/js/iView/css/iview.css', array(), '0', 'all' );
    		wp_enqueue_script( 'ivew-slider-js', get_template_directory_uri() . '/js/iView/iview.min.js', array( 'jquery' ), '0', true );
    		wp_enqueue_script( 'jquery-easing', get_template_directory_uri() . '/js/iView/jquery.easing.js', array( 'jquery' ), '0', true );
    	 }

    (I added "is_home() ||")

    Now... the remaining problema is that although the CSS and JS load correctly yhe entire slider div is still hidden.

  5. estebanglas
    Member
    Posted 1 year ago #

    Ha!

    Found it...!! I added the same condition on theme-plugins.php

    if ( is_home() || is_front_page() ) { ?>
    
    		<script type="text/javascript">
    			jQuery(document).ready(function($){
    				$('#iview').iView({
    					fx: '<?php echo $effects; ?>', // Slider transition.
    					captionSpeed: 700, // Caption transition speed.
    					captionEasing: 'easeInExpo',
    					pauseTime: <?php echo $speed; ?>, // Slider speed.
    					pauseOnHover: true,
    					directionNavHoverOpacity: 0,
    					timer: "Bar",
    					timerDiameter: "100%",
    					timerX: 1,
    					timerY: 0,
    					timerPadding: 0,
    					timerOpacity: 0.6,
    					timerStroke: 7,
    					timerBarStroke: 0,
    					timerColor: '<?php echo $timer; ?>',
    					timerPosition: "bottom-right"
    				});
    			});
    		</script>
    
    	<?php
    	}

    So... by adding the OR is_home() the thing was solved.

    For whatever reason the template did not recognise my home page with "is_home_page()", but "is_home()" does the trick.

    @bradthomas127 think you can include this in the plugin in future versions? Otherwise I'll be forced to build a branch ;-)

  6. bradthomas127
    Member
    Theme Author

    Posted 1 year ago #

    @estebanglas - Thanks for reporting this problem, the next update about to come out will not have this fix because it was approved 5 days ago and just wait for them to move it over but i will get it in the next update.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.