I have a custom post type and I have the code that loops through the CPT and displays it on the website, this post has been working and recently stopped displaying the posts on the website,
I have tried reimplementing my code but nothing seems to be working the loop seems fine to me. snippet of my code below. please help.
<div class="container">
<?php
$currentID = get_the_ID();
$today = date('Ymd');
$args = array(
'posts_per_page' => 6,
'post_type' => 'servicesdate',
'post__not_in' => array($currentID),
'meta_key' => 'date',
'orderby' => 'meta_value',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => 'date',
'compare' => '>',
'value' => $today,
)
)
);
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) :
while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div>content</div>
<?php endwhile;
endif; wp_reset_query(); ?>
</div>