ACFRepeater field of media type

Using ACF i have decleared a group of fields that i attach to Wordpress posts.
These fields have extra infos for the posts.
One of the fields is a repeater field with a child field of media type. This is done in order to be able to have attachement to each post.
My problem is that i can’t display these media files.
I create a template for displaying the default single post, i display there all the info, and at the botton i try do display the attachemnts.
I make a container that is a query loop, and inside there i am trying to display the repeater field.
The first question is, how can i display a media file ACF field ?
The second is, is this the correct way to display repeater fields ?

Hi Yannis,
I’ve recorded a quick video as an example: https://vimeo.com/711964440/c2025c2bac

Of course, it depends on the type of your media file attachments, but in my case (images / PDFs) it works without problems.

Best regards,
timmse

Edit: I almost forgot that there was a bug in RC2 - but as you can see in my video, we already fixed it. So in the next version, it will work for you too :slight_smile:

Great Video. TIMMSE, hope you make more it will be nice to create a filterable gallery on it. am currently doing before and after images. so my customer can upload before and also after images of the job, on separate but i want to display them together on a single post here is a screenshot of the idea I’m working on my local machine. the problem i have is how can i display them in a single gallery currently i can add them to display but it has to be on a separate gallery each. with no make sense because after i preview the before images i have to get out ot the lightbox and previw the after images . im sure im doing something wrong please let me know how to get it done also will be nice to be able to add filterable options on the Our Work page where all the posts are displayed and also has pagination

I DID NOT USE THE REPEATER ON THIS EXAMPLE .







Hi Luis,
if you want to have all images in one gallery or lightbox anyway, you can just use a single ACF Gallery field. That would definitely be the easiest way :smiley:

You can’t add two ACF fields to a single gallery, just like you can’t seamlessly merge two galleries into one bricks lightbox. Unfortunately, the repeater does not help either… Maybe one of the other users has an idea, but I can’t think of anything easier/better than using a single gallery right now.

2 Likes

yes, that’s what I’m going to end up doing, it will be great to add two Fields together, especially the gallery. i think if they enable adding multiple galleries on a single gallery-like element or does it may work, but, will see. for now, I’m going to stick to a single gallery