Home › Forums › General Issues › Get the image using image ID in repeater › Reply To: Get the image using image ID in repeater
Going back to the original code, there are quite a few syntax errors. Firstly, can you please read over the repeater field documentation to better understand how the has_sub_field to have_rows loops work?
I think @jamie code will work for you, however, the sub field name looks wrong. Just change
$attachment_id = get_sub_field('illustrations_image'); to your field name
$attachment_id = get_sub_field('gimages');
I am amusing that gimages is your sub field name.
Perhaps you could also post a screenshot of the edit page showing the repeater field and it’s sub fields? Also, please list the correct field names.
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!
CPT registration is coming to ACF! We demoed the new feature during the most recent session of ACF Chat Fridays. Check out the summary for the details. https://t.co/k2KQ3WWBAz— Advanced Custom Fields (@wp_acf) March 7, 2023
© 2023 Advanced Custom Fields.