mardi 24 février 2015

hide the title if the field is empty

I added my custom meta fields and i need to hide the title if the field value is empty there is my code :



<div class="row">
<div class="<?php echo leap_bws_col_class(3) ?>">
<strong>Geriatric Use:</strong>
</div>
<div class="<?php echo leap_bws_col_class(9) ?>">
<?php
$co_geriatric_use = get_post_meta(get_the_ID(), 'co_geriatric_use', true);
?>
<?php if (!empty($co_geriatric_use)) : ?>
<div class="box"><span>Geriatric Use</span><div><?php echo $co_geriatric_use; ?></div></div>
<?php endif; ?>
</div>
</div>

Aucun commentaire:

Enregistrer un commentaire