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
http://pastebin.com/YxkNAs78What am I missing to be able to have the query return zero results if no slug was passed to it?
Thanks
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How to stop query_posts or WP_query from returning results if no criteria?’ is closed to new replies.