I am using a custom post type with custom fields to display tour dates on a page. Some of the posts have both a "from" and "to" date (because they last for more than one day) and some only have "from" (because they're only one day), and I want all future or current tour dates to be displayed.
It's all working perfectly, except for some reason the posts that only have a "from" date stop showing if that date is in 2016 or later. I'm very confused!
Here are the args:
$today = date('Ymd'); $tour_args = array( 'post_type' => 'tour_date', 'posts_per_page' => -1, 'orderby' => 'meta_value', 'meta_key' => 'tour-date-from', 'order' => 'ASC', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'tour-date-from', 'value' => $today, 'compare' => '<=', ), array( 'key' => 'tour-date-to', 'value' => $today, 'compare' => '>=', ), ), );