• Resolved dvirhazout

    (@dvirhazout)


    hey!
    I put this code in the each comment loop:

    <?php
    if ( !empty( $comment->comment_author_email ) ) {
    	$md5 = md5( $comment->comment_author_email );
    	$default = urlencode( '' );
    	echo "<img  src='https://www.gravatar.com/avatar.php?gravatar_id=$md5&amp;size=40&amp;default=$default' alt='' />";
    }
    ?>

    problem is that sometimes the image is not showing at all and the default image of gravatar is being shown.

    I also tried gravatar2 plugin but it was worse that the above code.
    can anyone help me??
    thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • problem is that sometimes the image is not showing at all and the default image of gravatar is being shown.

    Not a bug. That’s what it’s supposed to do if the commenter doesn’t have an image set up at gravatar.com.

    If you don’t want the default gravatar logo to be displayed, create your own default image and upload it to your server.

    Then, put the URL to your image between the '' here:

    $default = urlencode( '' );

    Thread Starter dvirhazout

    (@dvirhazout)

    I’ll explain myself-
    I’m currectly making tests for a new wordpress theme I’m making and I made 2 emails with gravatar image.
    for 1 of them, the image not working..

    Ah.

    Your code is fine. Assuming that the email in the 2nd user profile is identical to the 2nd email at gravatar.com, then this would be a problem with the gravatar service. It likes some of the faq stuff might be relevant.

    Thread Starter dvirhazout

    (@dvirhazout)

    thanks for all!
    resolved ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘having problems in gravatar’ is closed to new replies.