Roots Discourse

How to force searches to use Soil nice search url?

#1

I purchased the soil plugin and have it installed & activated. As well I’ve flushed permalinks. I see that a direct call to the “nice search” url works /search/{query here} but the default search does not call the /search/ url it calls the default search url by adding the full query at the end of the base url. What do I need to do make all searches redirect to the nice search url? Did I miss a part of the setup or is there something additional I need to do? Any help is greatly appreciated!

0 Likes

#2

If you’re not using Sage, you’ll need to add add_theme_support('soil-nice-search'); somewhere in your theme/site.

What’s the URL look like? The way the module works is that the nice search is only applied if there are no additional query strings added onto the search

0 Likes

#3

I am using sage (sorry I didnt mention that) The current URL I get when searching for “hello” is http://localhost:3000/?post_type=post&s=hello
Even removing the hidden post_type input its still gives me the same base url http://localhost:3000/?s=hello

I am overriding the default wordpress search bar template. Is there a certain form action I should be using or something?

0 Likes

#4

It should happen automatically, see http://roots-example-project.com/?s=hello

0 Likes