donalyza.com

Avatar

Hello! I'm Donalyza Agaton, a Blogger who loves Web Design, a rock and r&b Audiophile, a psp Gamer, a hobbyist Photographer, an amateur Videomaker, a gadget geek Girl, and a proud Filipino.

donalyza: I already have the WordCamp Philippines 2008 T-shirt! 4 days ago

How To: Style Author Comments in Wordpress

Posted in: WordPress

The other day I wrote a post on How To: Customize your own style in showing the number of comments. Today I’ll be discussing on how to highlight the author’s comments. It’s just easy to follow and I know you can do it in just a few minutes.

To start of, we are going to edit your comments.php and style.css. If you are a Wordpress user definitely you know what I’m talking about. For newbies,Here’s an easy way to access your site. go to admin panel> presentation> theme editor> then just click the you want to change.

Let’s begin.

  1. Open the comments.php within that file. Search for the code that read as

<?php foreach ($comments as $comment) : ?>
<li class=”<?php echo $oddcomment; ?>” id=”comment-<?php comment_ID() ?>”

Remove the second line and change it using the code below. Don’t forget to modify the ones that are marked red.

<li class=”<?php if ($comment->comment_author == ‘TYPE AUTHOR’S NAME‘ &&
$comment->comment_author_email == ‘TYPE AUTHOR’S EMAIL ADDRESS‘) echo ‘authorcomment’;
else echo $oddcomment; ?>” id=”comment-<?php comment_ID() ?>”>

After you update your comments.php, we will add styles to it. Open your style.css, we are going to design the class for “authorcomment. Look on comments section and add this code.

.authorcomment {
background: #666666;
}

This code varies on how your theme was made. Analyze the code but once you understand the principle you can apply it in your theme.

Don't miss any post. Subscribe to RSS or by email now.
Tags: ,

Comments

RSS feed | Trackback URI

Comments »

No comments yet.

Your Ad Here

Trackback responses to this post

Leave a Comment, Win a Friend!

Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.
blog stats ss_blog_claim=26b83e33748acc79fc695f757f72db87