These are the old docs and will be removed soon – new 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
- Create a new page which we are going to use to hold your search results – give it a title at least and save.
- In the post editor, paste the Search Form shortcode, and on a new line, paste the results shortcode – eg
[searchandfilter id="1" show="results"]
- View the page to verify the form is being displayed and the initial set of results
- 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:
- Create a folder in your theme folder called
- Copy the file
wp-content\plugins\search-filter\templates\results.phpfrom the templates folder in to the newly created folder in your theme –
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:
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:
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.