Wordpress Comments Styling


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <ol id="commentlist">
  2. <?php foreach ($comments as $comment) : ?>
  3. <?php // The extra stuff to get commenter's role
  4. $user_id = $comment->user_id;
  5. $role = ( isset( $roles[$user_id] ) ? $roles[$user_id] : '' );
  6. ?>
  7. <li class="<?php echo $role; ?>">
  8. <p>By <?php comment_author_link() ?> - <?php comment_date() ?></p>
  9. <?php comment_text() ?>
  10. </li>
  11. <?php endforeach; ?>
  12. </ol>
  13.  
  14. #commentlist li { border:2px solid white; } /* not logged or subscriber */
  15. #commentlist li.administrator { border:2px solid red } /* blog admin */
  16. #commentlist li.editor { border:2px solid blue } /* editor */

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.