Forums Forums Search & Filter Pro Stop showing Results when no filter is selected

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

    Anonymous
    #31421

    Hello!

    Hoping someone will help out….?

    Thanks!

    Ross Moderator
    #31456

    Hey 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

    Anonymous
    #31570

    Ross,
    Thank you for the reply!
    I was out of town, so couldn’t write back.

    To tell you the truth, I am a novice at coding, at best, so could you elaborate, please?

    Thanks again!

    Ross Moderator
    #31688

    Hi 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

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