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)