Okay, this one’s a bit of a toughie.
The posts on my site are events, from the custom post type “Events”. They list out on the main page in chronological order, dictated by a datepicker in the post meta.
What I want:
Events in the past (anything before ‘today’) will not be loaded.
I’ve been fiddling with the wp_query for ages, just can’t figure it out. I’m using the EXTRACT mode to save out the input date, and use that in the query args to sort by the event date (not the post date, which is irrelevant in this instance). I figure if I could somehow, in the query, compare the event date to today’s date, then I can make it like,
event_date >= today_date
Any advice on how to do this? These are my args for the query:
$args = array(
'post_type' => 'events',
'meta_key' => 'event_date',
'orderby' => 'meta_value',
'order' => 'asc',
'posts_per_page' => -1
Hoping I won’t have to wait a month for a response like the last guy
You must be logged in to reply to this topic.