Very lightweight jQuery script that wraps search terms in an HTML5 mark tag when referer is a search engine or within wp search results.
To make it work, you will need to take two steps! (I) A normal installation and activation procedure and (II) adding CSS styling rules to get highlighting for browsers that do not support HTML5 like Internet Explorer 8 or older. Without that last step, visitors using older browsers will not see any hilites.
I. Install now or use the slick search and install feature (Plugins > Add New and search for "highlight search terms") in your WP2.7+ admin section or follow these basic steps.
II. Add at least one new rule to your themes styleheet (style.css or a custom stylsheet or a custom css plugin) to style highlightable text.
For example use .hilite { background:#D3E18A; } to get a moss green background on search terms found in the content section (not header, sidebar or footer; assuming your Theme uses a div with class "hentry").
Please find more examples under the Other Notes tab.
Requires: 2.3 or higher
Compatible up to: 3.3.2
Last Updated: 2012-4-21
Downloads: 12,232
Got something to say? Need help?