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.





Please VOTE for this page at: ADD TO DEL.ICIO.US | ADD TO DIGG | ADD TO FURL | ADD TO NEWSVINE | ADD TO NETSCAPE | ADD TO REDDIT | ADD TO STUMBLEUPON | ADD TO TECHNORATI FAVORITES | ADD TO SQUIDOO | ADD TO WINDOWS LIVE | ADD TO YAHOO MYWEB | ADD TO ASK | ADD TO GOOGLE


1 Comment


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

    $post->post_author

    So:

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

    I guess this is a good example as well :)

    Posted April 29, 2008, 9:44 pm

Leave a reply