i currently have the following:
<?php
$field_name = "text_field";
$field = get_field_object($field_name);
?>
<table>
<tbody>
<?php
if( isset($field['value'] ): ?>
<tr>
<th><?php echo $field['label']; ?></th>
<td><?php echo $field['value']; ?></td>
</tr>
<?php endif; ?>
</tbody>
</table>
my goal is to make the entire table row collapse and not display if there is no value entered.
clearly a novice. thanks for taking a look.
field[‘value’] will always be set.
Instead do if (!empty($field['value'])
or just if ($field['value'])
either should work.
thanks johnny boy! you’ve done it 🙂