Author Highlighting

I read this post by Matt Cutts awhile back (I recommend subscribing to his blog, some useful stuff there) and now that my blog is getting to the point where people are commenting on my posts and I am commenting back, it made sense to implement this on my blog. Going through his instructions I had a couple things to add. Instead of just adding a new line to your css file with a background color, I would recommend duplicating the .alt section of your css and then changing the color there. That way all the other formatting sticks with your comment. For example, all of my comments have rounded corners, if I just added the line he recommends, my comments are square. Enough said there.

The other section I wonder about but doesn’t really apply to my blog, is for blogs with multiple authors. His code says:

if (1 == $comment->user_id)

which only highlights the comments of the admin user – who may not even be the original author. Someday, when I’m a WordPress hacker, I’ll tell you what the correct line should be, or some other guru can add it. But there should be something like:

if ($article->user_id == $comment->user_id)

Again I don’t know what the right variable for the $article->user_id would be. If you take the time to figure it out, let us know.

1 comment

  1. Funny, just checked the other comments on Matt’s post again and it looks like the right variable is:



    if( $comment->user_id == $post->post_author)

    I guess this is a good example as well :)

Leave a comment

Your email address will not be published. Required fields are marked *