0

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?

2
  • How are you doing the filtering? Commented Feb 9, 2018 at 12:30
  • fetching posts that have certain taxonomy terms, using the meta_query WP_Query args. Commented Feb 9, 2018 at 12:38

1 Answer 1

0

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 }

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.