Tagged: ,

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #793061

    Dear support team,
    we added the PHP code as suggested in post https://kriesi.at/support/topic/button-for-next-slide-grid-row-anchor-link/ to our functions.php.:

    function add_custom_script(){
    ?>
    <script>
    (function($){
    var button = $(‘.avia-caption-content a[href=”#next”]’);

    $(button).click(function() {
    $(‘a.next-slide’).trigger(‘click’);
    });

    })(jQuery);
    </script>
    <?php
    }
    add_action(‘wp_footer’, ‘add_custom_script’);

    Unfortunately this codes seems to have syntax errors:
    Parse error: syntax error, unexpected ‘$’, expecting variable (T_VARIABLE) in XXXXXXXX/wp-content/themes/enfold/functions.php on line 571

    Could you please be so nice and check the code for us.
    Thank you,
    Bernd

    #793075

    Hey Bernd,
    Try this in your functions.php instead

    function add_custom_script(){
    ?>
    <script>
    (function($){
    	var button = $('.av-slideshow-caption a[href~="#next"]');
    
    	button.click(function(e) {
                    e.stopImmediatePropagation();
    		$('.next-slide').trigger('click');
    	});
    
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script');
    
    

    Best regards,
    Mike

    #793217

    Wonderful, Mike! It works just fine. Thank you so much!
    Regards,
    Bernd

    #793232

    Hi,

    Glad that Mike helped you :) Thanks for using Enfold :)

    Best regards,
    Nikko

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Button for next slide’ is closed to new replies.