Dynamic Text inside lightbox caption

Hi there, is any chance to have dynamic text (Title acf etc etc) on the lightbox caption for image and video?
Thanks

@Louis

Anything on this? Caption usage also for the lightbox in combination with a gallery?

Thank you.

Hi all,

You can do all of this and more in the caption of your Lightbox.
When you select the type of element to load in the Lightbox (image or video)
this opens up more parameters including a Caption field:

In the Caption field, you can call HTML tags, ACF fields and even functions in which you could pass whatever you can imagine needing.

For ACF field you need to use {acffield=the_name_of_your_field}
To return a function you need to use {return=function_name(parameters)}

In my example the full caption is made of:

{acffield=artwork_title}, {return=term_name(get_the_ID(),'jg_year')}<br>{return=jg_artwork_full_dimensions(get_the_ID())}

Where you can see a mix of an ACF Field, simple text (the coma) call of a function returning terms of a Custom Taxonomy, a HTML tag (
) as well as the call of a function calculating measure conversions.

So in brief, yes you can do a whole lot on the Lightbox caption, basically anything you can imagine!

Have fun playing with it!!

3 Likes

Thanks Luis, as usual… and thanks also to your amazing team :slight_smile: