Autarchy of the Private Cave

Tiny bits of bioinformatics, [web-]programming etc

    • Archives

    • Recent comments

    Search Hilite (highlight) WordPress plugin

    1st October 2006

    When you search something on the Internet, it is always convenient to have your search terms highlighted in every page you find. Often you need to use “Cached page” to see your terms – which is not quite convenient and comfortable.

    Did you think about the convenience of those of your visitors who came to your blog from, say, Google? If not – it is the time to. With the Seacrh Hilite WP plugin you can highlight search terms in your page, if your visitor comes from Google, Yahoo, Lycos or Baidu, or even your own blog’s search.

    This plugin is installed and activated as usual.

    I’d recommend to: go to Options > Search Hilite, set the “take CSS Style from my Stylesheet” checkbox, cut the sample CSS code from the box just below the checkbox, and paste it into your theme’s style.css file (without the lines “< style type='text/css' >” at the beginning and “< /style >” at the end). This decreases generated HTML page size, and is a proper way to handle styles.

    Another tip is to edit the wp-content/plugins/search-hilite/search-hilite.php file and add the following line at the and of the file, just after other similar add_filter lines:

    1. add_filter(’the_title’, ‘hilite’);

    This will enable highlighting in the post titles, not only content. However, is the search term to be highlighted occurs within the “title” of a link, it’s display will be broken. I contacted plugin author, asking what can be done about it. As soon as there is an answer – I’ll add it here.


    Leave a Reply

    XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>