I’m on the brink of questioning my own sanity with this one.
So I’ve got this query_posts call used in one of my templates:
query_posts(array( 'post_type' => 'some-post-type' ));
Somewhere around a week ago it suddenly stopped working (no changes to the codebase).
Replaced it with this:
$wp_query = new WP_Query(array( 'post_type' => 'some-post-type' ));
And everything works.
$wp_query objects created are identical in both cases but in first case have_posts returns nothing and in second one returns
true. On the very same page query_posts with another post_type works, but not with the one I need.
What could be the problem here? There should be no difference between these calls or am I missing something?
P.S. Calling directly
$wp_query->query($args)also returns nothing.
- The topic ‘new WP_Query works and query_posts does not’ is closed to new replies.