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!