II. In most up to date themes (including WP’s own Default theme) post and page content is shown inside a div with class hentry.
This class is recognized by the hilite script, which means search terms found in post and page content will be highlighted but not similar terms that coïncidentaly reside in the page header, sidebar or footer.
If your current theme does not use the hentry class (yet), this plugin will look for IDs content, main and finally wrapper (which might include the header, sidebar and footer areas) but if none of those are found, it will not work for you out of the box.
See the last of the FAQ’s for ways to make it work.
100% automatic code highlighting using the Prettify library. No shortcodes, no classnames, fully automatic and…
How to Highlight the Search Terms in Results in WordPress
In an attempt to make your WordPress search even more user friendly, you can highlight the search terms in the results. We did this for one of our clients, so we thought it would be useful for other users. In this article we will show you how you can highlight search terms in the results in WordPress.
How to Highlight Search-Result in WordPress