Using a repeater field, I require to count the number of rows before I generate the output.
I’m using the method described here for looping through the results:
http://www.advancedcustomfields.com/resources/have_rows/
But before looping through the rows, is there a way to simply check for the number of rows?
The documentation says: “The the_row function also returns the row data as an array if you wish to store it as a variable and use it.”
It seems that this only works for the current row, it doesn’t give information about the total number.
When you get the repeater field with get_field(‘repeater’) the value returned will be the number of rows it contains.