Skip Navigation

[Resolved] Add slider in a view

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user had some repeated image fields and wanted to create a slider using these images.

Solution:

I managed to create a flexslider plugin that should be able to help your.

Download and install the plugin in the link below.
https://drive.google.com/file/d/1CFU2_oBqe9PJBks8cT1VqMND8-ytDdVE/view?usp=sharing

Then create a content template for your post and add the following.

<div class="flexslider">
  <ul class="slides">
   [wpv-for-each field="wpcf-image_1"]
  <li>[types field="image_1" size="medium" align="none" resize="pad" padding_color="#FFF"][/types]</li>
  [/wpv-for-each]
  </ul>
</div>

After doing this then you will need to add the script for it to work.

Add this to the js section of the content template.

jQuery(window).load(function() {
   jQuery('.flexslider').flexslider();
 });
This support ticket is created 6 years, 10 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.

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

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 9 replies, has 2 voices.

Last updated by markusK-6 6 years, 9 months ago.

Assisted by: Shane.

Author
Posts
#620932
images in posts.jpg

Hello,

how can I add a imageslider in a existing loop view?
The images for the slider are in a Post Type Post as Custom fields.
Every Post has its own images.

hidden link

please help

Nice regard
Markus

#621120

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Markus,

Thank you for contacting our support forum.

You can actually do this by using the flexslider plugin and it can be downloaded by going to the link below.
https://woocommerce.com/flexslider/

Area your pages currently using a content template ? If so then you use this to display the images for the flexslider.

<ul>
  [wpv-for-each field="wpcf-image_1"]
  <li>[types field="image_1" size="medium" align="none" resize="pad" padding_color="#FFF"][/types]</li>
  [/wpv-for-each]
</ul>

Where you will need to replace wpcf-image with the slug of your image field.

You can check this ticket for further reference
https://toolset.com/forums/topic/flexslider-settings/

Please let me know if this helps or if you need further assistance.

Thanks,
Shane

#621355

Hi Shane,

thank you but is there a possibility with in other slider not woocommerce?
I do not want to install woocommerce.

Nice regards
Markus

#621404

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Markus,

I managed to create a flexslider plugin that should be able to help your.

Download and install the plugin in the link below.
hidden link

Then create a content template for your post and add the following.

<div class="flexslider">
  <ul class="slides">
   [wpv-for-each field="wpcf-image_1"]
  <li>[types field="image_1" size="medium" align="none" resize="pad" padding_color="#FFF"][/types]</li>
  [/wpv-for-each]
  </ul>
</div>

After doing this then you will need to add the script for it to work.

Add this to the js section of the content template.

 jQuery(window).load(function() {
    jQuery('.flexslider').flexslider();
  });

Please let me know if this helps.
Thanks,
Shane

#622488

Hi Shane,

thank you very much for good help, it works!!!
But there is a small failure with "AJAX results update when visitors change any filter values".
If AJAX results update when visitors change any filter values" is set so the slider disappears.

Example: hidden link

Nice regards
Markus

#622630

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Markus,

Awesome. On your view there should be a JS section where you added the filters.

On that JS section you should see a button called "Frontend Events" click this and then insert the code for after the view results have been updated.

Within that function that was added just add this callback.

jQuery(window).load(function() {
   jQuery('.flexslider').flexslider();
 });

Please let me know if this helps.
Thanks,
Shane

#622847

Hi Shane,

unfortunately that does not work.

here the code of my JS editor section:

jQuery( document ).on( 'js_event_wpv_parametric_search_form_updated', function( event, data ) {
	
  	jQuery(window).load(function() {
	jQuery('.flexslider').flexslider();
	});
  
}); 

Is that correct?

#622981

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Markus,

Would you mind providing me with admin access to the website so that I can have a look?

The private fields will be enabled for your next response.

Thanks,
Shane

#623332

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Markus,

All that was needed was this line
jQuery('.flexslider').flexslider();

It should now be working.

Thanks,
Shane

#623370

Thank You for all!!! It works!