OK, I set up a test site myself where I have this working.
Please remove the flexslider module, we will set this up manually ourselves.
First, you need to download the current version of the flexslider library from https://woocommerce.com/flexslider/. (Ignore the WordPress plugin link.)
Extract that archive file into your theme folder. We will copy the files we need into the required locations from there.
- Copy jquery.flexslider.js into a /js sub-directory in your theme folder (e.g. themes/twentysixteen/js)
- Copy flexslider.css into a /css sub-directory in your theme folder
- Copy the fonts folder into the same /css sub-directory (e.g. to themes/twentysixteen/css/fonts)
Now, edit your theme's functions.php file to correctly enqueue the required files, like so:
/**
* Enqueue files for flexslider
*/
add_action( 'wp_enqueue_scripts', 'flexslider_scripts' );
function flexslider_scripts() {
// enqueue the flexslider CSS file
wp_enqueue_style( 'flexslider-style', get_template_directory_uri() . '/css/flexslider.css', array(), '20161117' );
wp_enqueue_script( 'flexslider-script', get_template_directory_uri() . '/js/jquery.flexslider.js', array( 'jquery' ), '20161117', true );
}
Note that I did not add any tests for which page I was enqueuing these on, so they will be added to all pages.
For my test site I created a custom post type called collections, and assigned a repeating image field to it with a slug of slide-images. I created a test collection post to which I added several sample images.
Now I created a content template for single collection posts. This needs to output the required markup for the flexslider plugin to work. My template looks like this:
[wpv-post-body view_template='None']
<h2>Here comes the slider</h2>
<div class="flexslider">
<ul class="slides">
[wpv-for-each field="wpcf-slide-images"]
<li>
<img src="[wpv-post-field name='wpcf-slide-images']" />
</li>
[/wpv-for-each]
</ul>
</div>
We still need to trigger the flexslider to run on that page, so in the custom JS section we need to add a code snippet to initialise flexslider.
Here is my code snippet. Note that this is where you would add the custom settings which are described in the flexslider documentation.
( function( $ ) {
$( document ).ready( function(){
$('.flexslider').flexslider();
});
})( jQuery );
Now when you visit a relevant single post you should see the attached images in the slider.