A neat way to spice up your WordPress search page is to highlight search terms within your search results. I’ve seen some tutorials on the net on how to do this, but I haven’t found one that highlights both title and post content and is a drop-in modification for WordPress. Today I will bring you this drop-in hack for highlighting search terms on your WordPress blog.
Installation
1. Copy and paste the following code into your theme’s functions.php file:
function hls_set_query() {
$query = attribute_escape(get_search_query());
if(strlen($query) > 0){
echo ‘
<script type=”text/javascript”>
var hls_query = “‘.$query.’”;
</script>
‘;
}
}
function hls_init_jquery() {
wp_enqueue_script(‘jquery’);
}
add_action(‘init’, ‘hls_init_jquery’);
add_action(‘wp_print_scripts’, ‘hls_set_query’);
If you are having issues with copy-paste from this blog, here is a link to the same code in [...]
[Continue Reading...]


(11 votes, average: 4.45 out of 5)
(9 votes, average: 4.22 out of 5)












How to Track RSS Subscribers in a Blog Contest
Let me start off by saying that this post will not talk about how to get sponsors, how to determine prizes, or how to determine rules for a blog contest. This post will talk about how to tweak your WordPress blog to solve the biggest problem in running a blog contest to gain RSS subscribers.
[Continue Reading...]Problem
The issue here is that there is no easy way to track if each contestant has actually subscribed to your RSS feed. Without the ability to confirm RSS subscription, anybody can just claim that they have subscribed to your feed and get a free entry into the contest.
Solution
A known solution to this problem is to include a special contest code into your RSS feed and not have this code visible on your website. That way each contestant will be forced to grab the code from your feed and submit the code via comments [...]