consulting | design | information architecture | usability | ecommerce | programming | hosting
customers | case studies
open support ticket | discussion forums
history | culture | web standards | team | business partners

  A web agency weblog

Visit the new home page of Ventanazul »

10/21/2004

Changing the comments style in WordPress »

Reading a Douglas’s post about underlining text in Illustrator, I noticed how his own comments are highlighted.

Douglas uses Movable Type, so I went to WordPress forums and quickly found this article.

These are the easy steps:

Edit your comments template in WordPress and before starting the loop:

<?php foreach ($comments as $comment) { ?>

include the following:

<?php
$isByAuthor = false;
if($comment->comment_author_email == 'YOUR-EMAIL') {
$isByAuthor = true;
}
?>

then, before starting the comment text, add:

<?php if($isByAuthor ) { echo '<div class="authorcomment">';} ?>

and before closing the list element (li), include:

<?php if($isByAuthor ) { echo '</div>';} ?>

You should create a class called authorcomment in your CSS.

That’s it!

En: CSS Web | Por: Alexis | @ 9:28 pm

Comments

Leave a comment »

No comments yet.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Name (required)
Email (required)
URL
Enter the code shown in the image:
  authimage
Your Comment