Hello,
I need some help regarding displaying only the future dates. I have this code below.
<?php
$today = date('Y');
$month = date('n');
$args_future = array(
'nopaging' => true,
'posts_per_page' => -1,
'post_type' => 'events',
'post_status' => 'publish',
'order' => 'DESC',
'orderby' => 'date',
'meta_key' => 'time',
'date_query' => array(
array(
'before' => array(
'year' => $today,
'month' => $month
),
'compare' => '<='
)
)
);
$future = new WP_Query( $args_future );
?>
time is formatted like this -> January 2020
What I’m doing wrong here? the past dates and future dates are all displaying. I appreciate any help! Thank you!