advanced-custom-fields the_field() Check if field exists


Example

<?php if( get_field('text_field') ): ?>
    <?php the_field('text_field'); ?>
<?php endif; ?>

Here we use get_field() to determine if a value exists, and the_field() to echo it.