Find out how to improve the search experience in Genesis Framework child themes with the Relevanssi plugin and a custom results page.
In general, search within a WordPress website can be much better. And I’m not just talking about the search engine (which also could) but the way the results are displayed.
One of the options to improve it is to use the Relevanssi plugin at the same time you create a search page.
This plugin is one of the most popular in its category, with over 100,000 active installations and a score of 4.7 out of 5 in ratings. It also receives frequent updates.
To implement the improvement I propose, you need to create a search page and replace the Genesis loop with a custom one that supports Relevanssi.
Let’s go!
Steps to improve your Genesis search with Relevanssi
1. Install and activate Relevanssi
There’s no mystery to this part. Find the plugin in the repository, install it and activate it, just like any other. 🙂
2. Create a search.php file
Create a search.php file in the root of the child theme with the following code:
To see this and another 1097 code snippets of this website, login or subscribe here.
You now have a customized search/results page that removes the Genesis loop and replaces it with one that supports Relevanssi.
3. Indexing entries/pages in Relevanssi
Finally, to ensure that the content is displayed according to the template, you must index the entries and pages in Relevanssi.
You can do this from:
Settings -> Relevanssi -> Indexing -> Build the index
Final result
From now on, when you search the web you will see certain improvements:
- The results are displayed in order of relevance (not by date).
- The search term is emphasized.
- Custom metadescriptions are displayed and the search term is highlighted in them.
Thanks to these features, the user experience on the web gains several points, I assure you.
Conclusions
Do you also think that the search within WordPress could be much better?
Combine the Relevanssi Plugin with a custom results page to enhance the search experience in any Genesis child theme.
You can also check out a lighter weight solution to improve search in Genesis.
If you have any question, please leave it in the comments. And if you want to give me a suggestion for future snippets, please send it through the contact form.
Benefits of being a subscriber. 🙂