Recently I start using Gravatar (an abbreviation for globally recognized avatar). It is a free service for providing globally-unique avatars which was created by Tom Werner for blogs and web forums. I want to embedded it in my WordPress 2.7 template. So I try to insert the additional code as below in comments.php and it works. I set my icon size to 50×50. Others might like 40×40. It’s depend on personal preference.
41
| <?php if(function_exists('get_avatar')) { echo get_avatar($comment, '50'); } ?>
|
Original comments.php
40
41
42
43
44
45
| <li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">
<cite><?php comment_author_link() ?></cite> Says:
<?php if ($comment->comment_approved == '0') : ?>
<em>Your comment is awaiting moderation.</em>
<?php endif; ?>
<br />
|
New comments.php
40
41
42
43
44
45
46
| <li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">
<?php if(function_exists('get_avatar')) { echo get_avatar($comment, '50'); } ?>
<cite><?php comment_author_link() ?></cite> Says:
<?php if ($comment->comment_approved == '0') : ?>
<em>Your comment is awaiting moderation.</em>
<?php endif; ?>
<br />
|
References
No Comments
No comments yet.