Home › Forums › General Issues › 'Daily Features' Posts by Date › Reply To: 'Daily Features' Posts by Date
Hi @adammm
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!
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.