Support

Account

Home Forums General Issues Show field-values if date is in future

Unread

Show field-values if date is in future

  • Hi!

    I´m want to show values from an ACF-field (kalendetext) on a WordPress post if a date-value (kalenderdag) is in the future only. Otherwise it would be hidden. I´m trying the PHP-code below but can´t get it to work. Can anyone please help me solve this?

     <?php
    $today = current_time('Ymd');
    ?>
    
    <?php if( get_field(’kalenderdag’) >=
     $today ): ?>
    <p><?php the_field(’kalendertext’); ?></p>
    <?php endif; ?>
    
    
Viewing 1 post (of 1 total)

The topic ‘Show field-values if date is in future’ is closed to new replies.