Skip Navigation

[Resolved] Open image onclick

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.

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/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by manuelM-4 5 years, 2 months ago.

Assisted by: Luo Yang.

Author
Posts
#1502161

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

#1502661

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

#1512575

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