Forums Forums Search & Filter Pro filter more than one set of results

Viewing 6 posts - 1 through 6 (of 6 total)
  • Anonymous
    #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
    #235911

    It 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
    #235943

    Thanks Trevor – I’ll give it a whirl!

    Austen

    Trevor
    #235945

    I will wait to hear back from you.

    Anonymous
    #235962

    Hi 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
    #235971

    You 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.

Viewing 6 posts - 1 through 6 (of 6 total)