I have a Custom Post Type with an Archive page. I have a filter form on the page so the user can select some options and then find matching results.
How can I stop posts being displayed (using the loop) until a filter search is made by the user?
I have a Custom Post Type with an Archive page. I have a filter form on the page so the user can select some options and then find matching results.
How can I stop posts being displayed (using the loop) until a filter search is made by the user?
Isn't this easily to be achieved by checking if ?s= is set ? You do have to output the results of this search on the same page, by using the post archive link as action url.
if ( isset( $_GET[s] ) {
// show posts
}