Support

Account

Home Forums General Issues Hide relative content if field value is empty

Unread

Hide relative content if field value is empty

    • angang

    • December 6, 2018 at 8:45 am

    Hello,

    I have to use some informations before each field.
    But i don’t know how to hide for example “<h3>Cinema</h3>” if the field “cinema” is empty ?

    <?php if( get_field(‘cinema’) ): ?>
    <h3>Cinema</h3>
    <?php the_field(‘cinema’); ?>
    <?php endif; ?>

    <?php if( get_field(‘music’) ): ?>
    <h3>music</h3>
    <?php the_field(‘music’); ?>
    <?php endif; ?>

    Thank you

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.