Hello i’ve create a date field and need to setting this to display the post on day select.
So if select 12-12-2016 to 01-15-2017 my post must be display only in this date. Is possibile.
Yes, you can do it. First, you need to get the current day by using the
date() function. After that, you need to query the posts based on the current day. It should be something like this:
$today = date('Ymd');
$the_posts = get_posts(array(
'numberposts' => -1,
'post_type' => 'post',
'meta_query' => array(
'key' => 'date_picker_field_name',
'value' => $today,
Don’t forget to change the “date_picker_field_name” text with your date picker field name. This page should give you more idea about it: https://www.advancedcustomfields.com/resources/query-posts-custom-fields/.
Also, please keep in mind that there are differences between date picker field in PRO and free version. To learn more about it, kindly check this page: https://www.advancedcustomfields.com/resources/date-picker/.
I hope this helps 🙂