Support

Account

Home Forums Add-ons Repeater Field Check if Repeater Sub-field has been filled in

Solved

Check if Repeater Sub-field has been filled in

  • 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!

  • Solved, see above post./

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Check if Repeater Sub-field has been filled in’ is closed to new replies.