WordPress change author comment background

Lately I have noticed that when I leave comments sometimes the readers leaving comments aswell has no idea that I am the author of the post. This made me realise that I had to find a way of showing that I am the author of the posts in the comments section.

After some consideration I decided on just changing the background colour of my comments, I’ve seen many other blogs using this approach and it seems to work well and looks nice and clean.

Here is how I did it:

Open up comments.php and find

<li class=”<?php echo $oddcomment; ?>” id=”comment-<?php comment_ID() ?>”>

Replace it with

<li class=”<?php if (1 == $comment->user_id) $oddcomment = “authorcomment”;

echo $oddcomment; ?>” id=”comment-<?php comment_ID() ?>”>

After that add the following to you style.css file

.authorcomment {
background-color: #B3FFCC !important;
}

And that is it, all the comments made by admin will now be displayed with a background colour. If you would like to change the background colour just modify the hex value you put in the style.css file.

Hide your email address on your website from spam harvesters

Thanks to my pal Dawie from davisdmit.za.net for discovering this nice method for hiding your email from spam harvesting bots.

Chances are that if you run a website that you would like to display your email address on your site for people to be able to contact you, problem is that as soon as you add your email address spam hervesting bots can crawl your email and bombard you with all kinds ons unwanted emails.

Great news is there is a way to display your email as you would type it into your mail client without spam harvesting bots being able to pick it up. All that is required to view the email address is a javascript enable browser. The code makes use of calling your email address in unicode format that is unreadable to bots.

To display the email address info@test.co.za on your site you would simply call this script:

<script type=”text/javascript”>document.write(‘\u0069\u006E\u0066\u006F\u0040\u0074\u0065\u0073\u0074\u002E\u0063\u006F\u002E\u007A\u0061′);</script>

To convert your email address to unicode for display on your website head on over to AuditMyPc’s Free Adress Finder page and use the converter to convert your email address to a human readable, bot unreadable format.

Afrigator SA Topsites ::