Support

Account

Home Forums General Issues when value is empty it shows lable name Reply To: when value is empty it shows lable name

  • Hi Javadth,

    If you want to echo the label (and the value) only if $field[‘value’] is not empty you can do this way :

    <?php
    $field = get_field_object('sors');
    $value = $field['value'];
    if (!empty($value)){
        echo '<p>'.$field['label'].' : '.$value.'</p>';
    }
    ?>

    Hope it’s help.