Skip Navigation

[Resolved] Hide arrows and repeating images on sliders with less images then columns

This support ticket is created 2 years, 8 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 – 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: Africa/Casablanca (GMT+00:00)

This topic contains 1 reply, has 2 voices.

Last updated by Jamal 2 years, 8 months ago.

Assisted by: Jamal.

Author
Posts
#2118743
slider2.jpg
slider.jpg

Hi, I've added a Slider Block feeded by an image custom field. I set it to display 3 images.

My problem is that, if I add only 1 or 2 images to the custom field, the slider repeat the first image 3 or 2 times to fill the empty spaces (see screenshots).

Is there a way to not disply sliding arrows and repeated images if the custom field has less then 4 images?

Cheers

#2118923

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+00:00)

Hello and thank you for contacting Toolset support.

Actually, that is not possible. If you think that it should be supported by the Slider block, please suggest it on this form https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

As a workaround, you can use a custom function, that should return the number of images in the custom field. And use it inside a condition to display different sliders based on the number of images. For example, if there is only one image, you can display just an Image block. If there are 2 images, you can display a slider with two columns. And if there are more, you can display the current slider with 3 columns.

Check the custom function on this similar thread https://toolset.com/forums/topic/slider-with-one-image/#post-1964083
Remember that the function needs to be registered in Toolset->Settings->Front-end Content.

I hope this helps. Let me know if you have any questions.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.