• Resolved amirdbest

    (@amirdbest)


    I want users to be able to search within multiple categories using the checkbox. When only one category is selected the search works fine, however when two or more categories are selected at the same time (in checkbox mode), the search fails and nothing is found!

    https://wordpress.org/plugins/search-filter/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author DesignsAndCode

    (@designsandcode)

    Hey amirdbest

    This is because the search is using an “and” operator – what you need is an “or” operator.

    Ie – only posts that are have all the categories selected.

    I haven’t updated the docs yet but there is an argument “operators”.

    Use it like this:

    [searchandfilter fields="search,post_tag,categories" operators=",or,or"]

    This means that your posts can in ANY of the categories and they are shown, whereas by default and without this option, they must be in ALL categories to be shown.

    Thanks 🙂

    Thread Starter amirdbest

    (@amirdbest)

    WOW, thanks a lot. It worked perfectly. I was looking for this for so long.

    Plugin Author DesignsAndCode

    (@designsandcode)

    No problem, I’m updating the docs now too to add this in 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘checkbox grouping (multiple checkbox) does not work’ is closed to new replies.