Update: these instructions don't apply to WordPress 2.7+. See for more information. Ever wonder how to apply special styles to highlight WordPress comments written by the post author or another registered user? Good advice on this point is very rare. Most recommendations are to check against either an email address or a specific user ID. Both of these options are kludges, and both are fragile. Here's the right way to do it: If you want to check whether a comment is by the page author, this is the condition you want to test:
$comment->user_id == $post->post_author
To see whether a comment is by a registered user, check this:
$comment->user_id > 0
I compiled these into a very simple plugin. It has three functions: