Hide meta if empty
-
Hi everyone
I have a wordpress site under construction and what i wanted to do is quite simple i think… but i’m not very good in php language…I already succeed to display my article meta, by adding this code in my content.php:
<li><span class="element-fiche-technique">Lieu > </span><span class="info-fiche-technique"><?php the_field('lieu'); ?></span></li>
But i notice that if some article don’t have nothing in their “Lieu” meta, so i have the word “Lieu” anyway…
I tried to put this php code but it doesn’t seem to be functionnal.
<?php if(empty(the_field['montant-dh'])) { echo "vide" ; } else { echo "pas vide";} ?>
Thank you for your precious help!
Regards
Miran
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Hide meta if empty’ is closed to new replies.