[Plugin: Highlight Search Terms] Great plugin! Here's an addition (tags/cats
-
Great stuff, really like this little plugin!
Change the “if” block in hlst_get_search_query to add highlighting of categories and tags if they appear in the page itself:
if ( preg_match(‘@^http://(.*)?\.?(google|yahoo|lycos|bing|ask|baidu|youdao).*@i’, $referer) ) {
$query = preg_replace(‘/^.*(&q|query|p|wd)=([^&]+)&?.*$/i’,’$2′, $referer);
} elseif ( get_search_query() != ”) {
$query = get_search_query();
} elseif ( single_tag_title(”, false) != ” ) {
$query = single_tag_title(”, false);
} elseif ( single_cat_title(”, false) != ” ) {
$query = single_cat_title(”, false);
}
preg_match_all(‘/([^\s”\’]+)|”([^”]*)”|\'([^\’]*)\’/’, $query, $query_array);
- The topic ‘[Plugin: Highlight Search Terms] Great plugin! Here's an addition (tags/cats’ is closed to new replies.