WordPress Plugin GRAVATAR on K2
I like the idea of the wordpress gravatar plugin, that besides the posting you can see a picture of the autor. The worpress K2 theme supports the gravatar plugin. I just made a small modification.
How to get on Wordpress K2 the gravatar
1. Download the gravatar plugin and install it regular.
2. Modification: I remove the link on the pictures because I do not like hundreds of junklinks to gravatar.
On your Wordpress K2 theme go to COMMENTS.php an remove
[source:php]<a href=”http://www.gravatar.com/” title=”<?php _e(’What is this?’,'k2_domain’); ?>”>[/source]
Thats it, now you have some nice gravatars / pictures form the commentautors under Wordpress K2.
If you like just code and no wordpress gravatar plugin use this:
[source:php]<?php $gravatar_url = “http://www.gravatar.com/avatar.php?gravatar_id=” . md5(get_comment_author_email()) . “&default=” . urlencode($gravatar_default) . “&size=40″; ?> <img class=”gravatar” src=”<?php echo $gravatar_url ?>” alt=”Gravatar of <?php comment_author() ?>” />[/source]
Update:
The Gravatar Plugin works with all users on the wordpress k2 theme you edit the class from “X” to “G”:
[source:php]<?php if (function_exists(’gravatar’)) { ?> <img src=”<?php gravatar(”G”, 32, get_bloginfo(’template_url’).”/images/defaultgravatar.jpg”); ?>” class=”gravatar” alt=”<?php _e(”,’k2_domain’); ?>” /></a><?php } ?[/source]
Today Robert@Basic Thinking posted a new Gravatar Plugin: Easy Gravatars Plugin
Easy Gravatar has a backend config, maximum size pixels (32), allowed rating (x), default image und span style (float:right; margin-left:10px; display:block).
If I found time I will integrate Easy gravatar in my K2. If you did it give me some feedback how it works with the K2 theme.
Comments
12 Responses to “WordPress Plugin GRAVATAR on K2”
Leave a Reply

15
Adam @ TalkPHP.com
Version: 1.0.2
Last Updated: 2009-12-30
And will testing this pigin on my new K2 adventure.