I am trying to: make dynamic images open on click
Link to a page where the issue can be seen: /localhost
I expected to see:
Instead, I got:
I have a a few images display with the shortcode
[types field='photos' title='%%TITLE%%' alt='%%ALT%%' size='custom' resize='proportional' separator=', '][/types]
I want to make each image enlarge on click with a lightbox effect.
I´ve read every post about this but no solution is working for me.
If I use this shortcode, the images disapear.
[wpv-for-each field="photos"]
[types field='photos' title='%%TITLE%%' alt='%%ALT%%' size='custom' resize='proportional' separator=', '][/types]
[/wpv-for-each]
Any solution?
Thank you
Hello,
I assume we are talking about a repeating image field "photos" created with Toolset Types plugin, you can try these:
1) Add below PHP codes in your theme file functions.php:
add_action('wp_enqueue_scripts', 'add_thickbox');
2) setup the shortcode like this:
[wpv-for-each field="wpcf-photos"]
<a href="[types field='photos' size='full' url='true'][/types]" class="thickbox" rel="gallery">[types field='photos' title='%%TITLE%%' alt='%%ALT%%' size='thumbnail' resize='proportional' ][/types]</a>
[/wpv-for-each]
More help:
https://developer.wordpress.org/reference/functions/add_thickbox/
hidden link
Thickbox is not working.
I resolved my issue creating a repeating image field and then a view to show that group and showed it with a shortcode [wpv-view name="photos"]
Thank you