WP_Query returning true when no posts
-
I have the custom post type
cvwith no entries but WP_Query keeps returning i have entries?$query = new WP_Query(array('post_type' => 'cv','post_author' => $user_id, 'post_title' => $page_user)); if ( have_posts() ) : while ( have_posts() ) : the_post(); $post_id = $post->ID; echo $post_id; endwhile; $exists = 1; else : $exists = 0; endif;When i echo
$post_idi get 2896 but i have made sure to delete all posts for this custom post type with a query.How do i solve this?; WP_Query should return false.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘WP_Query returning true when no posts’ is closed to new replies.