Hi Elliott et al.,
I have a select field within a nested repeater that will display an item or not (make it public or private) depending on the setting of the select field.
The problem is, even if there are only private items within the section, ACF will still show the section title because there are items there.
I need to be able to query whether there are any public items in the section (the select field is within the nested repeater) and if not, not show the section at all.
Is this possible? Thank you very much in advance!
<?php if(get_field('categories')): ?>
<?php while( has_sub_field('categories') ): ?>
<div class="l_4 block">
<h3><?php the_sub_field('name'); ?></h3>
<dl>
<?php while( has_sub_field('items') ): ?>
<?php if( get_sub_field( "public" ) == "1" ): ?>
......item code......
<?php endif; ?>
<?php endwhile; ?>
</dl>
</div>
<?php endwhile; ?>
<?php endif; ?>