
Forcing WP_Query To Return No Results
Cameron Jones
Developer Tutorials, WordPress
The WP_Query object is the primary way of retrieving a post, or a number of posts from a WordPress site. There may be some occasions where you need a WP_Query object to return an empty result, so that WP_Query::have_posts returns false. Some good use cases could be testing for empty results when you’ve already added a lot…
View Article