Very lightweight jQuery script that wraps search terms in an HTML5 mark tag when referer is a search engine or within wp search results.
This plugin has no configuration options page and there is no predefined highlight styling. For any highliting to become visible in browsers that do not support HTML5 like Internet Explorer 8 or older, you have to complete step II of the installation process. 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
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
<?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 so that the array starting on line 55 contains your main content ID or class name. In the above example that can be either
'.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: 4.4
Last Updated: 2 months ago
Active Installs: 7,000+
1 of 1 support threads in the last two months have been resolved.
Got something to say? Need help?