Home › Forums › Add-ons › Repeater Field › Empty Repeater Field displays container › Reply To: Empty Repeater Field displays container
I just sent in a support ticket with the same issue. I recently upgraded to pro from the 4.x line with the paid repeater add on. Even though I have no rows, it is still rolling as if there is content. I will paste my code below. When I did the upgrade, I did not notice this. I happened to update to 5.1.1 this morning, so it may just be an issue with the recent release. Or this was there on Monday when I upgraded from 4.x to 5.1 and I missed it.
$i = 0;
if( have_rows(‘program_content_sections’) ):
while ( have_rows(‘program_content_sections’) ) : the_row();
echo ‘<section class=”prog-section-‘ . ++$i . ‘”><div class=”wrap in-page”>’;
the_sub_field(‘program_content_section’);
echo ‘</div></section>’;
endwhile;
else :
// no rows found
endif;
Thanks
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.