Hi there. So I am trying to add a slider to my site using the steps that are giving in this article: https://toolset.com/forums/topic/how-to-display-the-pics-i-uploaded-as-a-slider/#post-518295.
I made a custom field with repeated images. I want them to show as a slider.
However, it is not working (as you can see on: hidden link). I've been struggling quite some hours with it now. I could really use your help with this. I'll try to be as specific as I can on what I did. What I did is this:
1. I added this piece of code to my functions.php file in my childtheme:
function enqueue_flexslider(){
if ( !is_admin() ) {
wp_enqueue_script( 'flexslider-js', get_theme_file_uri( '/flexslider/jquery.flexslider-min.js' ), array( 'jquery' ), '1.0' );
wp_enqueue_style( 'flexslider-css', get_theme_file_uri( '/flexslider/flexslider.css' ), array(), '1.0' );
}
}
add_action( 'wp_enqueue_scripts', 'enqueue_flexslider' );
2. I created a folder called "flexslider" within my child theme (map: /public_html/wp-content/themes/child-theme-astra)
3. I pasted two files from the woocommerce flexslider 2 zipfile to my folder "flexslider", called: "flexslider.css" and "jquery.flexslider-min.js".
4. I created a Toolset content template called Slider2 (slug; slider2-slide), where in the template the code is:
[wpv-post-body view_template="None"]
<h2>Project images as a slider</h2>
<div class="flexslider">
<ul class="foto-evenement">
[wpv-for-each field="wpcf-foto-evenement"]
[types field='foto-evenement' alt='%%ALT%%' title='%%TITLE%%' size='large' align='none' resize='proportional' separator=', '][/types]
[/wpv-for-each]
</div>
And in the js editor I've put:
( function( $ ) {
$( document ).ready( function(){
$('.flexslider').flexslider({
animation: "slide"
});
});
})( jQuery );
Now the weird thing is that when I copy paste the html on my site (as you can see in the screenshot) nothing happens. However, when I change the name of the template to slider2-slide and add this as a shortcode to the page (as you can see in the other screenshot), the photo's are stacked under each other. And I get an error that says: " content not displayed because it produces an infinite loop. the wpv-post-body shortcode was called more than once with the attribute view_template="slider2-slide" over the post "8-weekse Mindfulness MBSR training", triggering an infinite loop. I'll upload a screenshot of this too.
I'm getting pretty desperate here. Please help me :). I want to use the "Slider with Carousel Slider as Navigation", shown at the flexslider website: hidden link.