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]

UPDATE:

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”

  1. Tim Bormann on October 30th, 2007 17:06

    This is a testposting, so I hope you can see my gravatar :)

  2. Robert on October 30th, 2007 19:30

    miep
    15

  3. josh on December 13th, 2007 00:33

    test

  4. Adam on January 9th, 2008 05:47

    I’ve actually created a Gravatar class if you click the link in my name. Loosely coupled and works like a dream – it also has a cache with an expiration date for the avatar – to save on loading times. It can merely load the avatar in locally.

    Adam @ TalkPHP.com

  5. Jonas on February 15th, 2008 17:00

    This is cool and I use K2. I wanted to post to see what happens when I don’t have a Gravatar setup. Thanks.

  6. Eule on February 26th, 2008 12:19

    Hey, your spam protection don’t know the simple math and my comment is lost! Grr..

  7. David(new comment) on July 2nd, 2008 20:47

    Testing my gravatar too…

  8. Rod(new comment) on August 31st, 2008 23:07

    Thanks for this. I’d been playing around trying to get this to work for a couple of hours without much success before finding this – you helped me out!

  9. Mooose(new comment) on September 7th, 2008 00:44

    Thanks

  10. Clausen(new comment) on October 2nd, 2008 10:11

    This is a test :(

  11. Fernando(new comment) on April 18th, 2009 08:20

    testing my gravatar.. me too. :)

  12. ErwinSK(new comment) on January 1st, 2010 00:37

    Downloaded today:
    Version: 1.0.2
    Last Updated: 2009-12-30
    And will testing this pigin on my new K2 adventure. :-)

Leave a Reply