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!
The ACF site is currently experiencing some issues.— Advanced Custom Fields (@wp_acf) September 29, 2022
We apologize for the inconvenience and we are working hard to get it back up and running as soon as possible.
© 2022 Advanced Custom Fields.