Lightweight search terms highlighter using jQuery. Wraps search terms with class="hilite" when referer is a search engine or within wp searc
This plugin has no configuration options page and there is no predefined highlight styling. You have to complete step II of the installation process for any highliting to become visible. Edit your themes Stylesheet (style.css) to contain a rule that will give you exactly the styling that fits your theme.
Don't want to edit your themes stylesheet? I can highly recommend Automattics own Custom CSS plugin!
Sure! See tab Other Notes for instructions and some examples to get you started.
Due to a problem with jQuery's $('body') call in combination with many other scripts (like Google Ads, Analytics, Skype Check and other, even basic, javascript code) in the ever increasingly popular Firefox browser, I have had to limit the script search term wrapping to a particular div instead of the whole document body. I chose div with class "hentry" since that is the most commonly used content layer class in WordPress themes. If that is not available, the script will look for divs #content then #main then #wrapper. However, in your particular theme, none of these divs might be available...
Let's suppose your theme's index.php or single.php has no <div <?php post_class() ?> ... > but wraps the post/page content in a <div id="common" class="content"> ... </div>. You can do two things to solve this:
A. Change your theme and stylesheet so the post/page content div has either class="hentry" or <?php post_class() ?>. TIP: Take a look at how it is done in the Default theme included in each WordPress release. But this might involve some real timeconsuming tinkering with your stylesheet and several theme template files.
B. Change the source of wp-content/plugins/highlight-search-terms/hlst.php on line 61 so that the array contains your main content ID or class name. In the above example that can be either '#common', or '.content', where a prefix '#' is used for ID and '.' for class.
C. Switch to a theme that does abide by the current WordPress conventions :)
Requires: 2.3 or higher
Compatible up to: 3.1.4
Last Updated: 2011-1-3
Downloads: 9,612




