Comments image - Gravatars?

Hey everyone,

I've been using Gravatars on my Wordpress site - seems okay, couldn't really find anything better. I found a post on here with some code for Gravatars - but as it says in the post the code bring backs an error.

I'm just wondering if anyone uses Gravatars or any other image function that they could recommend and explain how to go about it.

I use the default theme.

Also, I can't seem to but any space between the submit radio button and the comment box. Any tips?

As always,

Thanks!!!

Comments

  • Are you talking about this gravatar hack? http://www.zenphoto.org/support/topic.php?id=235&replies=12 The code seems to be fine. Anyway I'm going to use gravatar on my site but didn't have a time to do it ... yet :)
  • Yeah, I'm talking about that code. I get the same errors that the others did. The authors blog seems to be out of action so I couldn't follow up on the other link he gave.
  • If you follow instructions from the gravatar then it should work http://en.gravatar.com/site/implement#section_3_1 . Some others were stating that it works :) Or there might be some additional spaces which have to be removed from the code ...
  • Got it working ... edit image.php in your theme folder and find commentmeta div. After the div put the code below:
    `<?php<br />
    $email = getCommentAuthorEmail();

    $default = "http://domain.tld/yourdefaultgravatar.jpg";

    $size = 32;

    $grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=".md5($email)."&default=".urlencode($default)."&size=".$size; ?>

    image" alt="" class="gravatar" />`
  • Ellama,

    Thank you!

    Seriously, you really helped me out!

    I added this to the CSS code and away I went...

    .gravatar {
    width: 40px;
    padding: 1px;
    vertical-align: top;
    }

    Thanks again,

    Pierrot
  • sure, you made me to do it coz i'm a bit lazy :)) yep, i didn't include the css code, this one is ok for the basic formattin :)
  • Glad I could be of service! Hey, any idea on how to set a default image for those not registered with Gravatars. I'm getting the little question mark!
  • Sure. The default image is set in this variable `$default = "http://domain.tld/yourdefaultgravatar.jpg";` just change the url to your domain and your picture. It works like that you provide to gravatar an email along with your default location of a picture and if the users email is not found then gravatar returns the default path you specified. That's the way how it works :)
  • Thanks Ellama! It worked like a charm!

    This is my very first website so I'm a little clueless!
Sign In or Register to comment.