WordPress.org

Ready to get started?Download WordPress

Forums

Put an image next to author's name in comments (1 post)

  1. chadrew
    Member
    Posted 2 years ago #

    I've figured out how to put an image (I use a small star) next to author's name in the comments. I know WordPress already has CSS classes for author, admin, etc. but these classes apply to the whole <li> element and I wasn't sure how to make use of them.

    <?php
    if (get_the_author_meta('ID') == $comment->user_id) {
    echo ' <img src="YOURIMAGE" title="Author" height="12" width="12" />';
    } ?>

    Just sharing, and, does anyone see a problem with this thing? It seems to be working fine for me, hopefully it won't slow down the comment loading a lot.

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by chadrew
  • This topic is not a support question
  • WordPress version: 3.2.1