The standard template of WordPress (as others) normally provide for an alternate layout for the list of comments. In the standard template of such a class is set css alt , according to the logic:
1 2 3 4 5 | / / File 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 comment on a post:

I, for example, I used the following code in the comments.php file:
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->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->user_id==1 . Normally the ' ID of the administrator is 1 , if you use that user can write: $comment->user_id==1 . In this way, besides having the alternate layout on comments left by visitors, the answer is immediately recognizable author of the blog.






Latest Comments
Mark : @ Mark: Thanks for the answer. For example, if you have a code to save / use the folder ...
Mark : Thanks for the answer. For example, if you have a code to save / use the folder ...
Giovambattista Fazioli : @ Mark: in principle, absolutely, a lot depends on how and what to download. La. ..
Mark : Hello, good guide! I wanted to ask, you can use the same code to run a sql database? Instead of ...
Joseph : Hi I wanted to ask you how you can do in the post I uploaded a gallery of 50 images, for example, ...