Problem: I have a repeating image custom field, and I would like to show thumbnails of each image that link to full-size image files.
Solution: Use the wpv-for-each shortcode to iterate over each image, then use the types field shortcode to output the resized thumbnail and full-size image URL.
[wpv-conditional if="( $(wpcf-property-gallery) ne '' )"] <div class="text-center property-gallery"> [wpv-for-each field='wpcf-property-gallery'] <a href="[types field='property-gallery' size='full' url='true'][/types]">[types field='property-gallery' width='300' height='230' align='none' resize='crop'][/types]</a><br /> [/wpv-for-each] </div> [/wpv-conditional]
Relevant Documentation:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-for-each
https://toolset.com/documentation/customizing-sites-using-php/functions/#image
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 |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 4 replies, has 2 voices.
Last updated by barisS 7 years, 1 month ago.
Assisted by: Christian Cox.