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
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
Wonderful, Mike! It works just fine. Thank you so much!
Regards,
Bernd
Hi,
Glad that Mike helped you :) Thanks for using Enfold :)
Best regards,
Nikko