Home › Forums › General Issues › Filtering posts by date (Date Picker) › Reply To: Filtering posts by date (Date Picker)
It’s not working for me either!
I want to show posts with event_date field greater or equal than today.
Here’s my code, but the posts are not filtered. I tried without type or with NUMERIC or CHAR:
$today = date('Ymd');
$meta_query = array(
array(
'key' => 'event_date',
'compare' => '>=',
'value' => $today,
'type' => 'CHAR'
)
);
$args = array(
'post_type' => 'post',
'meta_key' => 'event_date',
'orderby' => 'meta_value',
'order' => 'ASC',
'paged' => 1,
'meta-query' => $meta_query
);
$wp_query = new WP_Query($args);
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.