Hi guys,
Is it possible to customize how the search results are displayed at all?
I’d like for the results to show excerpts from where the term lives. Kind of similar to google. For example, when you search a term on google it says
The title, then the link to the page and then below the link is a blurb or excerpt with that term highlighted or bolded in the paragraph.
Currently, when searching for something on a site built with enfold, the results show up as only the title of the page it lives on, and no specific blurb that it comes from.
Thanks!
Hey bobfurgo,
Thank you for using Enfold.
This is certainly possible, but it’s not available by default. And we don’t know of any plugin that has this functionality out of the box, so it will probabaly require a custom modification. Unfortunately, that is beyond the scope of support. Please hire a freelance developer or contact our partner codeable.
You can use javascript to extract the search parameter in the url and use its value to look for any similar words in the document. These methods might help.
// https://davidwalsh.name/query-string-javascript
// https://developer.mozilla.org/en-US/docs/Web/API/Element/outerHTML
Best regards,
Ismael
Ok no problem. Thanks Ismael!
Hi,
Did you need additional help or shall we close this topic?
Best regards,
Jordan Shannon
Well look here for example: https://webers-testseite.de/?s=Wordpress
this is a styled Search Results Page on editiing the loop-search.php
If a search item has a featured image it will be shown.
and some css – and that little Plugin: Highlight Search Terms
This highlights not only in the search results – it even highlights the term in the links you click on from that search results page.