Skip to main content

Comments By Me - Highlighted

2 min read

Today, while at simplebits I came across a post about Author Highlighting. This pertains to comments to posts and making the owner of the blogs comments stand out a bit more than everyone elses. The simplebits site is done with MoveableType (an fine blogging tool) - however I use wordpress so Dan's exact method wouldn't work for me.

Fortunatly for me a fellow by the name of Hasam added a comment to the story that shows how he does it with wordpress. So that you don't have to dig through that prior post to find the solution I am posting it here.

Basically you can just replace the code you have in your wp-comments.php file with the following chunk. The code you see here replaces the code that 39 and ends at line 42.

Technically I just inserted line 39 (set the password to look for, 41 (get the author "email" address, and updated line 42 which adds the class "authorComment" to any post made by me.

The real trick to the whole thing is using the email field as a password. Basically, as the author, you put the predefined password into the email field and then this code checks to see if you have the right password, if so it adds the authorComment class. This is better than comparing against author name or a known email address value as it prevents others from impersonating you.


Make sure you change the authorPassword variable value to something else and thats about it. If you have any questions or need help getting this going just post a comment here and I'll try to help you out.