Support

Account

Home Forums Add-ons Repeater Field Hide Sub Field Label and Value if empty

Unread

Hide Sub Field Label and Value if empty

  • Hi I am able to hide the value of a sub field if it’s empty but cannot figure out a way of hiding both the label and the value.

    I’m using the following code which will hide the value but still shows the label.

    Any ideas would be superb

    `
    <?php if( get_sub_field_object(‘ceiling_colour’)): ?>
    <?php $field = get_sub_field_object(‘ceiling_colour’);?>
    <p><?php echo $field[‘label’] ?>: <?php echo $field[‘value’] ?></p>
    <?php endif; ?>

Viewing 1 post (of 1 total)

The topic ‘Hide Sub Field Label and Value if empty’ is closed to new replies.