Designs & Code

Design, Development and WordPress

Search & Filter has moved home! Head to searchandfilter.com

If you had an account with us, don't worry, we've moved that too. Head on over to to our new website to download and access support.

These are the old docs and will be removed soonnew docs have moved here

—————————————————————-

 

Under the “Display Results” tab, ensure that “using a shortcode” is selected.

Once done, in the Shortcode panel (underneath the Publish box) you will now have another field containing your results shortcode.

A quick tutorial

  1. Create a new page which we are going to use to hold your search results – give it a title at least and save.
  2. In the post editor, paste the Search Form shortcode, and on a new line, paste the results shortcode – eg
    [searchandfilter id="1"]
    [searchandfilter id="1" show="results"]
  3. View the page to verify the form is being displayed and the initial set of results
  4. In your Search Form, update Results URL to the full URL of this page

*Results URL: if for example you had your Search Form on your homepage, but your results (shortcode) was within a page called “My Results”, then we would need to tell this Search Form where to find it – this is where Results URL comes in handy – here you must paste the full URL of the “My Results” page – so that Search & Filter knows where to load the results.

And thats really it! It should now be working, but of course we’ll need to configure a couple of additional settings to get it working optimally.

Customising the Results

If you wish to customise the display of your results, you must override the default template that is being used by Search & Filter:

  1. Create a folder in your theme folder called search-filter.
  2. Copy the file wp-content\plugins\search-filter\templates\results.php from the templates folder in to the newly created folder in your theme – wp-content\themes\your-theme-name\search-filter\results.php

From now on, Search & Filter will load this version of the template instead of its own – so you can make any customisations that are necessary.

But I have multiple search forms, and I don’t want all my results looking the same!?

Well that’s not too difficult – in this case you can use the ID of the search form to target it specifically – and place the template as you just have with the `results.php` file:

wp-content\themes\your-theme-name-\search-filter\

For example, if a Search Form had an ID of 14, then I would create a template in this folder called `14.php` – that only this Search Form could use for displaying its results – the file would then be located:

wp-content\themes\your-theme-name\search-filter\14.php

Configuring Ajax

The beauty of using the shortcode method with Ajax is that it almost works out of the box.  Simply enable Ajax and your good to go – just make sure that your Results URL is properly filled out and pointing at the correct page.