I'm using the following code to display posts with todays date or in the future... except the future part isn't working. If I take out the if statement then it shows all posts - in the past, present and future.
$today = date( 'd M' );
$pages = get_children( array(
'post_status' => 'future,publish',
'post_type' => 'event',
'sort_order' => 'DESC'
) );
foreach ( $pages as $post ) {
setup_postdata($post);
$item = get_the_date();
if ($item >= $today) {
?><h3><?php echo the_title(); ?> - <?php the_date(); ?></h3><?php
}
}
wp_reset_query();
How can I display posts with todays date and posts in the future?