Skip Navigation

[Resolved] image slider with thumbnail carousel

This support ticket is created 5 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by jozsefG 5 years, 2 months ago.

Assisted by: Waqar.

Author
Posts
#1338467

Hello

I'm trying to make an image slider for tourist accomodation pages. A big featured image first and under it thumbnails in a carousel. The additional images are set up in repeating fields and all are uploaded to their respective post already. So I need to use [wpv-for-each field="wpcf-filedname"]. I know hot to show the thumbnails like this but I need to add the carousel functionality for this. I've seen on the forum that the old image slider module was flexslider based but and it worked with [wpv-for-each] but I cannot find it anymore among the modules. The new approch is as I see to have a cpt for images and have post relationships and it is using the bootstrap carousel. But I cannot use this module because I cannot upload all the images again to a new cpt.

Can you helo me with this somehow? Maybe to implent the old flexslider approach?

#1338489
#1338789

Hi Jozsef,

Thank you for waiting.

For what you're planning to achieve, you can use "JQuery lightSlider" script:
hidden link

Please download the zip file from the link above and copy the folder named "dist" in your active theme's directory.

Next, in your content template, you can include the code for the carousel gallery like this:


<link type="text/css" rel="stylesheet" href="[wpv-bloginfo show='url']/wp-content/themes/twentynineteen/dist/css/lightslider.css" />                  
<script src="[wpv-bloginfo show='url']/wp-content/themes/twentynineteen/dist/js/lightslider.js"></script>

<ul id="imageGallery">
[wpv-for-each field="wpcf-image-field-slug"]
<li data-thumb="[types field='image-field-slug' url='true' size='thumbnail'][/types]">
    <img src="[types field='image-field-slug' url='true' size='full'][/types]" />
</li>
[/wpv-for-each]
</ul>


Note: Please replace both instances of "twentynineteen" with the actual folder of your active theme and "image-field-slug" with the actual slug of your image field.

In your content template's "JS editor" tab, you can include the code to initialize the image carousel:


jQuery(document).ready(function() {
	jQuery('#imageGallery').lightSlider({
		gallery:true,
		item:1,
		loop:true,
		thumbItem:9,
		slideMargin:0,
		enableDrag: false,
		currentPagerPosition:'left',
	});  
});

Note: To read about the settings/options that this script supports, you can visit, the official reference at:
hidden link

I hope this helps and for more personalized assistance around custom code, you can also consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/

regards,
Waqar

#1339055

This works like a charm! It's exactly what I needed. Thank you very much Waqar, you are great 🙂 🙂

#1339057

My issue is resolved now. Thank you!