Looking for support? You can access the support system via your account.
- This topic has 17 replies, 2 voices, and was last updated 5 years ago by .
You must be logged in to reply to this topic.
Looking for support? You can access the support system via your account.
Forums › Forums › Search & Filter Pro › S&F with Relevanssi Premium
Tagged: filter, relevanssi, wordpress
I’ve a website with Relevanssi enabled. In the header i’ve got a simple search fields. The results are displayed on the search.php page. What would like to know is how to do the following:
1) Using the S&F plugin only add an appropriate filter ([searchandfilter]) to the search result page after a search is been made. The results are displayed via a WP_Qeury.
2) Change the language of post type filter to English. Cannot find this in the settings.
1. You would need to change the header search field to send the search as a Search & Filter text search, or make a simple search form and replace the one in your header with that.
2. Are you using a plugin like WPML or Polylang?
Can you show me that code as it appears in that searchform.php template, and how is that called (what code) in the (header) template that calls it?
It’s very simple:
<form action="<?php echo site_url(); ?>" class="searchform" id="searchform" method="get" role="search">
<input type="text" id="s" name="s" value="" placeholder="Search... + Enter" />
<span class="icon"><i class="fas fa-search"></i></span>
</form>
This will give you an idea of how to edit that form to use our plugin:
<form action="<?php echo site_url(); ?>search-results/" class="searchform" id="searchform" method="get" role="search">
<input type="text" id="s" name="_sf_s" value="" placeholder="Search... + Enter" />
<span class="icon"><i class="fas fa-search"></i></span>
</form>
Note that I have changed the action to point to a slug named search-results
. This would also need to be set in the form design (edit our form and on the Display Result settings tab). I have also edited the name from s
to _sf_s
.
I think that should then work?
I am not sure if there needs to be a slash before search-results in that code.
You must be logged in to reply to this topic.
© 2024 Search & Filter Support. All Rights Reserved.
This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
We also use cookies to store items in your cart as well as allowing your to login on the site.
You can adjust all of your cookie settings by navigating the tabs on the left hand side.
By continuing to use this site, you also agree to our Privacy Policy.
Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.
*Other cookies used for logging in and cart functions will only be used when you use those features and cannot be disabled.
If you disable these cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.
This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.
Keeping this cookie enabled helps us to improve our website.
Please enable Strictly Necessary Cookies first so that we can save your preferences!
More information about our Cookie Policy