WordPress: improving the list of comments

The standard WordPress template (as others) normally provide for an alternate layout for the list of comments. In the standard template of a class instance is set css alt , according to the logic:

1
2
3
4
5
/ / Comments.php
$oddcomment ; ?> id="comment- <?php comment_ID ( ) ?> "> <Li <? Php echo $ oddcomment;?> Id = "comment-<? Php COMMENT_ID ()?>">
[...]
/ * Changes every other comment to a different class * /
Oddcomment = $ (empty ($ oddcomment))? 'Class = "alt"':'';

) e una volta a class="alt" . This means that the tag li $oddcomment is set once a blank ( "" ) and once a class="alt" . A modification could be useful to introduce another class when the author of the blog to post a comment:

image

I, for example, I used the following code in comments.php:

1
2
3
4
5
<? Php
( $comment -> user_id == 3 ) ? ' Authcomment = $ ($ comment -> user_id == 3)? ' '' ; authcomment ':'';
( empty ( $classcomment ) ) ? ( ( $authcomment == '' ) ? ' alt' : '' ) : '' ; Classcomment = $ ( empty ($ classcomment))? (($ authcomment =='')? 'alt':''):'';
?>
?> <?= $authcomment ?> " id="comment- <?php comment_ID ( ) ?> "> <Li class = "<? = $ Classcomment?> <? = $ Authcomment?>" Id = "comment-<? Php COMMENT_ID ()?>">

del vostro utente. The line $comment-&gt;user_id==3 may vary according to ' ID of your user. I, for one, do not use the administrator to respond on the blog, but I have my user ID=3 . , se usate questa utenza potete scrivere: $comment-&gt;user_id==1 . Normally the ' ID of the administrator is 1 , if you use this utility you can write: $comment-&gt;user_id==1 . In this way not only to have the alternate layout on the comments left by visitors, the answer is immediately recognizable author of the blog.

3 comments to "WordPress: improving the list of comments"

  1. October 22, 2008 DnaX :

    XD One of my comment!

    I differed in my blog comments as the result of trackback to differentiate them from the comments. There are those who do not put them in the comments but it makes a section with a special layout.

  2. October 22, 2008 Giovambattista Fazioli :

    @ DnaX: I was thinking too ... :)

  3. July 26, 2009 Gabriel:

    Hello! Follow this blog for a while 'time and I must give my compliments to the creator! is really beautiful ..

    I'm cimentanto in creating a blog, and since I am not very experienced, I would like to know if by chance there are plugins to modify the layout of the comments, or if someone could kindly postarmi a little 'code examples.

    I'd like to change the shape and appearance of the comment box, I hope I explained myself ..

    Greetings

Leave a comment

TAG XHTML PERMITS: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> INSERTION CODE:
 <pre></pre> // blocco generico <code></code> // blocco generico [cc_actionscript][/cc_actionscript] // Actionscript [cc_actionscript3][/cc_actionscript3] // Actionscript 3 [cc_css][/cc_css] // CSS Style Sheet [cc_html][/cc_html] // HTML [cc_js][/cc_js] // Javascript [cc_objc][/cc_objc] // Objective-C [cc_php][/cc_objc] // PHP [cc_sql][/cc_sql] // SQL 


Stop SOPA