[Resolved] How to stop query_posts or WP_query from returning results if no criteria?
I am attempting to use either query_posts() or WP_Query() to return the results of a custom taxonomy. I pass an array of slugs to the query based on a form’s request. (Basically, this is a custom search function). I want that when no slugs are passed to to my queries, that the query returns 0 results. By default, it appears to return all results.
This is what I’m currently doing:
Displaying custom taxonomies based on form request
What am I missing to be able to have the query return zero results if no slug was passed to it?
- The topic ‘[Resolved] How to stop query_posts or WP_query from returning results if no criteria?’ is closed to new replies.