Im stuck.
The code below works fine for the most part, except, I want the <h4>Attachments</h4>
appear only if there are attachments. Right now it appears whether there are attachments or not. If I move <h4>Attachments</h4> after while have-rows repeater, it appears with each attached document. This is driving me insane.
<?php if( have_rows('attachment_repeater') ): ?>
<h4>Attachments</h4>
<?php while( have_rows('attachment_repeater') ): the_row();
$case_document = get_sub_field('case_document');
$title = $file['title'];
?>
<?php if( get_sub_field('case_document') ): ?>
<div style="border-bottom:1px solid #dfdfdf;padding:10px 0; width:100%; display:table">
<div><a href="<?php echo $case_document['url']; ?>"><?php echo $case_document['title']; ?></a></div>
</div>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>
Any ideas how to resolve this issue