Hi
I’m trying to create a function that returns a count based on “rows” within ACF that are complete.
Here is the code: https://pastebin.com/9nK09hrM
This works fine elsewhere, but when adding it as a function and trying to return it elsewhere it returns as 0. It seems that the following line isn’t working:
while ( have_rows('program') ) : the_row();
I also tried this, which is the way I used elsewhere and works fine:
while ( have_rows('program', 'option') ) : the_row();
But this just makes the page crash/break.
Any ideas?
Thanks.
A similar question is asked here https://support.advancedcustomfields.com/forums/topic/repeater-field-in-functions-php-2/
You may need to include the $post_id when calling have_rows()