Hey there, it looks like you are using the shortcode within a post, which means you do not need to use the php tags, instead use:
[searchandfilter fields="search,category,post_tag" types=",checkbox,checkbox" headings=",Categories"]
Use this code and check again 🙂
Thread Starter
r78o1k
(@r78o1k)
Great thanks that has worked! That was so fast!! I am putting the code into a post. Can I put it into a widget and have it in one of the headers? If so How?
Also, if I want to do a search for more than one category, I want the result to only bring up posts with both those categories.
currently if I search for breakfast and chairs, the result will bring up all posts with breakfast and/or all with chairs. But I the result to only bring up posts with Both breakfast And chairs.
Hey r78o1k, yeah you can.
To put it in a widget, just create a text widget, and use the shortcode like in the example I just gave you and the search form will appear in a widget.
If you want to include it in one of your headers then you’ll have to use the first shortcode that you used, with the php tags – but you’ll have to go in and edit your theme files to figure out where to place it.
To use operators use it like:
[searchandfilter fields="search,category,post_tag" types=",checkbox,checkbox" headings=",Categories" operators=",and"]
But the widget by default is using “and” already, the other value can be “or”.
I just did a test search for “all day breakfast” and “change table” which took me to this url:
http://www.mumswholovebrunch.com/category/all-day-breakfast+change-table/
If you can see, it is already using the “and” operator!
Check out the docs for more info and if you like the plugin please leave us a rating! 🙂