Undefined WP_Query::has_posts()?

This must be wrong.

I was testing something so I did:

Read More
$queried_post = new WP_Query(array('posts_per_page' => 5, 'offset'=> 1, 'category' => 1));
var_dump($queried_post->has_posts()); exit;

And I get the error:

 Fatal error: Call to undefined method WP_Query::has_posts() 

I am working with this inside a class INSIDE the theme ….

var_dump($queried_posts); shows 5-6 posts. even if their were no posts I would get false. I should get …. true ….

Related posts

1 comment

Comments are closed.