Put sticky posts first in results
If you want to have sticky posts first in results when they match the search query, just add this code to your theme functions.php:
Knowledge base contains information on how to use Relevanssi. There are lots of features that are documented in the knowledge base. Here's an index to the knowledge base, with all the entries sorted under different topics.
The user manual functions page is also a good place to look at.
If you want to have sticky posts first in results when they match the search query, just add this code to your theme functions.php:
Relevanssi can index extra fields created with Profile Builder Pro. All you need to do is add the custom fields’ names to the Relevanssi setting “User fields to index” (this is a Premium feature, so you need to have Relevanssi Premium). You can find the names of the fields from the Profile Builder > Manage…
In some cases, Relevanssi requires modifications to the search result template for the search results to work properly (in particular when using Relevanssi Premium to search user profiles and taxonomy terms). Adjusting the templates is really simple, usually just changing the_permalink() to echo relevanssi_get_permalink() is enough, but framework themes like Genesis make small changes like these more complicated. Sarah Moyer took…
Avada is one of the most popular WordPress themes on the market. All post types are not found Avada has search settings, including a list of post types to show in the results. If your Avada search is not showing all post types, attachments or user profiles, the problem is probably in the Avada settings.…
I have a term who name is for, example, Great Blue Trojans. The slug is GBT. I want to be able to search for ‘GBT’ and return all the posts with this term. When I search ‘Great Blue Trojans’ I get the hits. When I search GBT I do not. Is this as expected? Is…
If you want to auto-direct the user directly to the result if there’s just one result for the search, that’s quite easy. Add the following code to your site: This is not Relevanssi-specific and works just fine even without Relevanssi. If you are using Relevanssi on a multisite system, you need a small change to…
A site I’m working with has a handful of “protected” posts (password required to view). For various reasons, we don’t want to show these in search results. While there is no excerpt shown, I’d prefer for people to not even know they exist. Relevanssi sees protected posts as public posts (because their post status is…
Relevanssi has been working nicely for the normal usecase. But how does one setup indexing of attachment files. When someone searches by a file name or an extension like pdf, there are no results. I have enabled ‘attachment’ at Relevanssi ‘Indexing options’ and still there are no results. Relevanssi doesn’t index attachment file names. For…
On one of our sites we have 2 search boxes, one where you can do a normal search and the other where you can search for employees or departments. The employees/department search is done by using the relevanssi_do_query() function. Can we use fuzzy matching on the normal search and disable it on the employees/department search?…
Are post ID’s searchable in Relevanssi? No. Relevanssi does understand the WP_Query p parameter to restrict the search by post ID. However, if you want to search by post ID, it’s very simple to make that happen using the relevanssi_content_to_index filter hook: Add that to theme functions.php, reindex and searching for post ID’s works. Originally…