Home › Forums › Add-ons › Repeater Field › Display Title of File in href using Repeater › Reply To: Display Title of File in href using Repeater
I can see from your code that the repeater field is called
Why then do you have the code:
$attachment_id = get_field('add_audio_file');
This is not the attachment id, it is the repeater field array…
The attachment ID is found WITHIN the loop via:
$attachment_id = get_sub_field('add_audio_file_repeater');
But, now looking at your field names, I think you have them around the wrong way. Please read the documentation before coding and asking questions, it is very simple to understand. I think you have just copied / pasted without looking at the actual code.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
The most recent ACF Chat Friday featured a live demo of how to register CPTs directly in the plugin, one of our most requested features. Check out the summary below for a replay of the demo, and don’t forget to register for the next session! https://t.co/k2KQ3WWBAz— Advanced Custom Fields (@wp_acf) March 9, 2023
© 2023 Advanced Custom Fields.