Support

Account

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.