• Resolved rukcs

    (@rukcs)


    How do I place a search box on the header, and when a search is typed I should get results from the portfolio categories I’m currently watching

    for example

    I have 4 categories in portfolio. I have a page that displays portfolio items by categories as following

    ALL | Category 1 | Category 2 | Category 3 | Category 4

    I would like to add a search on top of it, but when clicked on category 2 , the search should filter only portfolio items having category 2

    And when All is selected the search should filter results from All portfolio items and so on

    https://www.ads-software.com/extend/plugins/relevanssi/

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

    (@msaari)

    Search box is a HTML form that has a text input field that’s named “s” (check the HTML source code for any WordPress page that has a search form to see the exact code).

    For category restrictions, add a hidden input field in the search form code.

    <input type="hidden" name="cat" value="CATEGORY_ID" />

    and replace CATEGORY_ID with the ID number of the category you want to restrict the search to.

Viewing 1 replies (of 1 total)
  • The topic ‘Search within portfolio items by categories’ is closed to new replies.