Support » Plugin: Relevanssi - A Better Search » Limit search with form html

  • Resolved winterstreet

    (@winterstreet)


    I’m trying to have two searches, one for most places which searches everything, and another that is in a sidebar that only searches one category. I think I can do something like: if this template then add this bit of code on my searchform.php.

    On the Relevanssi settings it shows that you can add the html:
    <input type='hidden' name='cats' value='list of cats and tags' />
    to the search form. I’ve done that with the ID# in for the value, yet the search still returns all categories.

    Just trying to see if I can limit the search widget to return the one category, then I’ll do the if then bit somewhere, but right now my test shows it as not working.

    https://wordpress.org/plugins/relevanssi/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mikko Saari

    (@msaari)

    That should work. If it doesn’t, I’d start by checking that the search results you’re seeing are actually provided by Relevanssi. Do you see, for example, Relevanssi-generated excerpts, or do the results change if you deactivate Relevanssi?

    Thread Starter winterstreet

    (@winterstreet)

    My mistake, I had the wrong ID# in there. Basically a non-existent ID# so I think it was just returning everything. Thanks for the quick reply.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Limit search with form html’ is closed to new replies.