Error thrown

Call to a member function have_posts() on int