Home › Forums › General Issues › Show only future event › Reply To: Show only future event
you could do it after query with php with code like that:
<?php while($event->have_posts()) : $event->the_post();
$today = date('Ymd');
$event_date = get_field('date');
if (strtotime($today) <= strtotime($event_date)) {
?>
<li>
Posted on: <?php the_field('date'); ?><a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
</li>
<?php } endwhile; ?>
else you need to work with meta_value that is always build like 20150430
year month day without spaces, no matter what input or output format you give the date field with acf settings for that field.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.