Home › Forums › Add-ons › Repeater Field › Access Nth subfield of a repeater › Reply To: Access Nth subfield of a repeater
Repeaters are stored in the format:
repeater_name_X_sub_field
Where X is the row number and it starts at 0. So the first row would be like repeater_name_0_sub_field, the next repeater_name_1_sub_field, etc.
You can use that with get_post_meta to display a specific value, like:
get_post_meta($post->ID,'repeater_name_0_sub_field',true);
But depending on the field type you’re displaying, like if it’s something like an image or similar, that wouldn’t run it through ACF’s display process so you could have to do some work on your end there.
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.