Display Caption or Description of ACF Gallery Image

I’ve created an ACF Gallery that I’m displaying within a layout (see here)

I’d like users to be able to give photo credit for each image. I’m hoping I can achieve this by displaying the image caption or description.

How can I display an image’s caption or description in a looper setup? I’m fairly familiar with how loopers work, I just need to know what key to pull. If neither is possible can I display a custom field on media items?

Hello @OctoCog,

Thanks for writing to us.

Regretfully there is no option for that at the moment, I would suggest you please contact a developer who can assist you with your concerns or you may subscribe to One where customization questions are answered. Please note we don’t provide custom development support. it is out of the support scope.

In case you have an idea about coding please have a look at this thread for reference.

Thanks

Hi @prakash_s

Understandable, I did try a few methods of modifying the code you provided without luck.

How about this…I created an ACF Text field that works on all media attachments. This field is called Media Credit.

It is now visible within the ACF Gallery on all Gallery Images:

Here is a slideshow I created that dynamically shows all of the images in the ACF Gallery. How can I get that Media Credit field to appear below each image?:

Hello @OctoCog,

To better assist you with your issue, please provide us access to the site so we can check your layout. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Best Regards.

I just posted the secure note.

Hello @OctoCog,

I have logged in and checked your layout and I found out that your ACF Gallery will only return either the Image URL or the Image ID.

You choose to return an Array, therefore the Gallery will only have these:

So, we need another looper that will get each of the information about the image. To do that, inside the Slide, you will have to insert a DIV as your Looper Provider which will have a Query String: post_type=attachment&post_mime_type=image&p={{dc:looper:item}} and then a Text element as your Looper Consumer that will display the “Media Credit” information about that image. In this case, we will be using {{dc:post:meta key="media_credit"}}

By the way, please remove any unnecessary Looper Provider and Looper Consumer in your single layout. Enable and Use the Looper Provider and Looper Consumer when it is needed.

  • See the secure note below.

Best Regards.

@ruenel Thank you that worked!

Hey @santosfel5,

You’re welcome!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.