Support

Account

Home Forums General Issues Hide field if empty Reply To: Hide field if empty

  • Try this code, Might be it will be work for you.
    <?php
    $value = get_field(‘your_field_name’); // retrieve the field value
    if ( ! empty($value) ) : // check if it’s not empty
    ?>
    <p><?php echo esc_html($value); ?></p> // then output it (or your custom markup)
    <?php
    endif;
    ?>