After reading about MT author comment highlighting on Dan’s blog, I became a little jealous (I admit it) - I really wanted to have my comment replies to be differentiated from the others and was glad to find Tom’s website which outlined one pretty dern nifty trick to get the same results in wordpress.
I had it running for a while, but as I was working on setting the same thing up for a client, I realized something - something I didn’t notice before. I was using Kitten’s background hack to alternate different style classes to odd/even comments. Combining these two techniques would give an extra unwanted class which would invalidate the page (and possibly cause some styling faux paux’s). So I came up with a little work around (very small one).
I won’t go into all the details because the instructions for each hack are already online (and very easy to follow I may add). First, set up your comment background hack according to kitten’s instructions and set up your author comment highlighting according to Tom’s instructions - except you can skip adding anything to the <li></li> just yet.
This is where my little tweak comes into play. Somewhere in the <li></li> around line 38 in wp-comments.php (the file you should have been editing all along), you will insert this code in leu of Tom’s and Kitty’s:
<?php if($isByAuthor) { echo 'class="author-comment"';} else { if($i%2) { echo 'class="alt-comment"';} }$i++ ?>
in your style sheet, you will have two new li classes:
#commentlist li.author-comment (style how your comments will look)
#commentlist li.alt-comment (style how the alt - odd - comments will look)
#commentlist li (you can use your regular list styling properties for all other comments
)
Disclaimer: I am not a programmer. I came up with this quick little fix because I wanted to use two hacks that weren’t initially playing nice with each other as I had them set up. I’m posting this to my blog in hopes it may help some others out who may have overlooked this.