Making your comments section look nice
You need to know some CSS and have a fair idea of how a PHP code works.
Have you come across those sites where comments are displayed beautifully with a separate look for author comments and an alternating look for the rest of the folk?
Chilligavva too carries this style. Take a look. I shall quickly tell you how to do the same with your wordpress blog. There are two steps, step-1 the code manipulation and step-2 defining the styles for the same.
Part-1: Manipulating the code
Look for the following code in comments.php located in the folder
“wordpress-folder / wp-content / themes / current theme / “
if ($comments) :
foreach ($comments as $comment) :
$isByAuthor = false;
if($comment->comment_author_email == ‘email@domain.com’) {$isByAuthor = true; }
?>
And replace it with the following code
foreach ($comments as $comment) :
$isByAuthor = false;
if($comment->comment_author_email == ‘email@domain.com’) { $isByAuthor = true;}
if (‘alt’ == $oddcomment && $isByAuthor == true) $oddcomment = ‘auth’;
elseif (‘alt’ == $oddcomment && $isByAuthor == false) $oddcomment = ‘def’;
else $oddcomment = ‘alt’;
?>
Make sure that you substitute the generic “email@domain.com” in the above code with the actual email of the author, as defined in the wordpress settings.
Part 2: Defining styles in style.css
Written By
Lakshmi MareddyFiled Under
WordpressArticle Tags
tutorial , tweak , WordpressTrackback URL
http://www.chilligavva.com/2006/10/06/comments-tweak-for-wordpress.html/trackback