Home › Forums › General Issues › Using date picker to set post expiry date › Reply To: Using date picker to set post expiry date
Hi @lerq
The easiest way is to edit the code WIHIN your loop. This could would normaly display the title, link, excerpt for the post.
Just add some logic that compares the date value to today. Something like this:
<?php
$today = date('Ymd');
$expire = get_field('expire');
if( $expire < $today )
{
// skip this loop
continue;
}
?>
Thanks
E
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.