Home › Forums › General Issues › Filter Custom Post Type by ACF Date Picker Field › Reply To: Filter Custom Post Type by ACF Date Picker Field
Ugh! I didn’t see that you removed the post type query bits when you provided the debug code, so the proper post type was not being queried:
/* Order Posts based on Date Picker value */
$posts = get_posts(array(
'post_type' => 'event', // name of custom post type
'meta_key' => 'event_enddate', // name of custom field
'orderby' => 'meta_value_num',
'order' => 'ASC'
));
But I still only get <pre> </pre>
output.
I give up. 6+ days on & off trying to figure out what seems like it should be a fairly basic feature. This project needs to move forward 🙁
I just want the date output as “Month Day, Year” and a Past Events page to show only events with an end date that has passed and an Upcoming Events page to show only events with a future date.
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.