Forums › Forums › Search & Filter Pro › filter more than one set of results
Tagged: multiple search results
- This topic has 5 replies, 2 voices, and was last updated 6 years ago by
Trevor.
-
Anonymous(Private) March 9, 2020 at 12:56 pm #235905
Hi
We’re building a site to showcase holiday accommodation. We’d like to have a page that groups accommodation by size, so a block of properties that sleep up to 4, a block of those that sleep 5-8, and another for 9+. At the top of the page, we’d like the filters for, eg, dog friendly, pool available, etc. These filters should apply to all three blocks of properties.
Can this be done with this plugin?
Thanks!
Austen
Trevor(Private) March 9, 2020 at 1:43 pm #235911It might be possible IF:
Ajax is not in use. So, each submission of the filter causes a page reload.
and
The form is set to custom mode and you use a PHP template where the query arguments are set (and then wp_query is run) in that template before each section, where you add our filter as an argument to each of those queries, like so (change the ID to match your form):
['search_filter_id'] -> 123456,In reality, you should keep the query arguments down to (maybe) just the post type, as our argument would override most arguments anyway.
Anonymous(Private) March 9, 2020 at 3:39 pm #235962Hi Trevor,
Working on this more tomorrow, but in the meantime – and I apologise if I’m missing something obvious which hasn’t shown up in my searching – how can I restrict the categories in the search form to just a few without restricting any of the results? We have about 20 categories, but only want three or four as filtering options in the form itself.
Cheers
Austen
Trevor(Private) March 9, 2020 at 5:13 pm #235971You can do this in one of two ways.
One is to use the advanced settings in the Form UI field settings, deselect the Sync with Settings option and exclude all the ones you don’t want. This has the disadvantage of needing to be edited when you add new terms that you need to exclude, IF you are likely to do that.
The alternative is to do some coding, using this filter:
https://searchandfilter.com/documentation/action-filter-reference/#filter-input-object
To remove all terms except the ones you want.
-
AuthorPosts