jasonglisson
10/12/2014 - 3:23 AM

Wordpress - Display Future/Past Events using ACF and Loop From https://wordpress.org/support/topic/query-date-array-to-display-future-events

Wordpress - Display Future/Past Events using ACF and Loop From https://wordpress.org/support/topic/query-date-array-to-display-future-events-only

$event1 = current_time('Ymd');
	$args = array(
        'post_type' => 'events',
	'post_status' => 'publish',
	'posts_per_page' => '10',
	'meta_query' => array(
		array(
			'key' => 'event_date_ends',
			'compare' => '>=',
			'value' => $event1,
			)
			),
	'meta_key' => 'event_date_ends',
	'orderby' => 'meta_value',
	'order' => 'ASC',
	'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1 ),
);