Hi,
I have this block of code to check whether any content has been added a repeater sub-field. It displays the content if the user enters text but it doesn’t hide the code (or not show the code) if the user hasn’t entered any text.
The repeater is in an options page too.
What am I doing wrong?!
<?php if(get_sub_field('slide_caption')) { ?>
<div class="caption">
<p class="caption-title"><?php the_sub_field('slide_caption'); ?></p>
</div>
<?php } ?>
EDIT: Solved. The code was correct all along. Was updating the wrong version of the site. Doh! So sorry. Perhaps this post will help someone in the future though!