Query Meta Values for Event Dates
-
I am trying to query posts for an events listing at https://visitwisrapids.com/events-calendar/. Right now this is what my code says:
$todaysDate = date('Y/m/d'); query_posts('category_name=events&meta_key=end_date&meta_compare=>=&meta_value=' . $todaysDate . '&orderby=meta_value&order=ASC&posts_per_page=-1;');
I have custom fields for the start date and end date of each of these events. I want to compare the end date to today’s date, but sort by the start date (custom field = start_date). Is this possible and if so how do I do it?
- The topic ‘Query Meta Values for Event Dates’ is closed to new replies.