This task can be spit up into a few tasks:
1. Find today’s date. This can be done with the date function is PHP. Please research this first, but it will look something like this:
$today = date('Ymd');
2. Next step is to add the date field to the ‘feature’ post type. It seems like you have already done this. Make sure the save_format is ‘yymmdd’ This JS format will match the PHP format of Ymd
3. Lastly, just add in a meta query into the query_posts parameters. Please research this, but it will look something like this:
<?php query_posts( 'post_type=feature&posts_per_page=1&meta_key=date_field_name&meta_value=' . $today); ?>
Hope that helps
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!
© 2022 Advanced Custom Fields.