Home › Forums › General Issues › Hypothetical : How can I add values from a field in a repeater? › Reply To: Hypothetical : How can I add values from a field in a repeater?
You need to do one of a few things.
The first is loop though the field twice.
If you use
get_field('progress_barRepeater') this will return the entire acf field as a nested array, you could then loop though the rows of the array to get the values and then you can loop through them again to display each row.
You can capture the output of a single loop using an object buffer, creating html and collecting the information all at the same time. Then after the loop output the “average” and then the content of the object buffer.
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!
2022 was a big year for Advanced Custom Fields, with more capabilities, a new generation of ACF Blocks, a refreshed UI, and a new home. Our year in review post looks at advancements we’ve made and offers a glimpse of the future.— Advanced Custom Fields (@wp_acf) January 6, 2023
© 2023 Advanced Custom Fields.