I'm trying to setup a custom post type page 'events' which lists out upcoming events and past events. The date for the event is stored in a custom field using (Advanced Custom Fields) plugin. Now I'm trying to use a WP_Query and loop through all posts that have there custom field date (event_date) set to after the current date. Any help on how I could achived this?
My effort below. thanks
$today = date('yyyy-mm-dd');
$args = array(
'meta_query' => array(
array(
'key' => '_acf_event_date',
'value' => ''.$today.'',
'type' => 'date',
'compare' => '>'
)
),
'post_type' => array(
'events'
),
'posts_per_page' => -1,
'paged' => get_query_var('paged')
);
$query = new WP_Query($args);
loop
ideas?
post_metatable - RRikesh