I wonder if anyone can help me with an issue I am having with 'search' in WordPress/WooCommerce.
I am building a database of artists and architects who have worked on English Churches: http://staging.englishchurchartandarchitecture.co.uk/
I need to find a really good search solution.
So far, I have gone with a paid plugin called Ajax Search Pro which is doing a good job, but has one major drawback which may mean I have wasted the cost of the plugin! It doesn't highlight search results on the results page.
The nature of this site means that a large portion of the likely search terms will be buried in the content of the entry.
As the site is very much in the development stages and only one letter of the alphabet has been populated, it's not that easy to appreciate the nature of this problem fully.
However, taking 'Smith' as an example; if you enter 'Smith' into the search field it does return entries (which are, in effect, WooCommerce 'products) which contain 'Smith'. Even with only one letter (A) populated, there are several entries that contain Smith. It's going to be a pretty poor user experience if you cannot see at a glance which entries contain the Smith you're looking for.
I have contacted the plugin developer and he has said a flat 'No' to this feature.
I found this snippet: https://perials.com/highlight-searched-terms-in-wordpress-search-results/
Frustratingly, with my theme, there's a glitch (we think this is theme related). It works perfectly with results that aren't wrapped in an anchor tag. For reasons no one has been able to figure out, when a search result is wrapped in an anchor tag, the snippet renders the code as text so instead of being nicely highlighted, it appears something like this:
Armitage and <span class="search-highlight">Smith</span>
For the record, I have also tried a plugin called Highlight Search Terms. This only works partially, which is barely better than working at all!
So ... I would REALLY appreciate if you could advise me on a solution which:
- Directs users to a search results page
- Searches Titles, categories AND search terms within content
- Highlights the results on the search page
If it helps, I am running a theme called 'Roof' from Victor themes, WP 5.4.1 and WooCommerce 4.1.0.
Thanks,
Martin
- Instant search and filtering without reloading the page.
- Real-time indexing supports your search as you type.
- Theme compatibility for both desktop and mobile.
- Prioritized results based on your site traffic.
- Spelling correction and highlighting matching terms.