Forums › Forums › Search & Filter Pro › Stop showing Results when no filter is selected
- This topic has 4 replies, 2 voices, and was last updated 10 years, 8 months ago by
Ross.
-
Anonymous(Private) December 3, 2015 at 7:29 pm #31369
Hi!
I am using category and Tag as the search Filter. With no category or tag selected, if the form is submitted, it returns all posts from all categories / tags.I want it such that UNLESS a category or a tag is selected, no results show show….
Thanks in advance, and Regards
Ross Moderator(Private) December 4, 2015 at 4:31 pm #31456Hey Varun
There is no integrated option, but you could add some custom logic to your results template.
You could use the active query class to see if anything is selected:
http://www.designsandcode.com/documentation/search-filter-pro/accessing-search-data/
And of course, if nothing is selected, don’t display results (ie, the
have_posts()part of the template).Thanks
Ross Moderator(Private) December 8, 2015 at 12:22 pm #31688Hi Varun
This really is a bit of custom work/integration you would need to do yourself until I figure out a way to include it in the plugin.
Instructions on how to use that class are in the above link but I understand for now this is really aimed at developers.
An alternative would be to create an empty page with just the search form on it, then when a user submits the form they would be redirected to the results page.
Thanks
-
AuthorPosts