Support

Account

Home Forums Backend Issues (wp-admin) How to clear date automatically?

Solving

How to clear date automatically?

  • Hello! I use date fields for the announcement of events. Posts are always published, only event dates change.

    My code:

    <?php if( get_field('start_date') ): ?>
    Event: <?php the_field('start_date'); ?> - <?php the_field('end_date'); ?>
    <?php endif; ?>

    Is it possible that fields clearing automatically after expiring of end_date ?

  • You need to create a cron that queries the posts, looks at the value of the field for each post and then clears/updates the field if your condition is met.

  • Will be grate if you help me with cron job settings for this puzzle)

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘How to clear date automatically?’ is closed to new replies.