WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] can't see default avatar on comments (7 posts)

  1. desingenia
    Member
    Posted 1 year ago #

    Hi, just after configuring a gravatar image for my admin profile on our WordPress site we have stopped seeing default avatar images for all anonymous comments.
    In Settings->Discussion nothing has been changed. I still have Mysterious Man selected as before, but now no image is showing for anonyomus comments. I have disabled and enabled "use avatar images" but they still do not show, although my personal gravatar does appear for my admin profile comments. This even happens now for new comments. Also tried several browsers always with same results.
    When copying URL of the deafualt image that does not appear I get http://0.gravatar.com/avatar/8d7f6abdbc9a689e339acff91adc59df?s=52&d=52&r=G which links to the following error message "The type of image you are trying to process is not allowed". Any hints??
    Thanks in advance to anybody that can give us a hand with this.
    Best regards, Adrian.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Unless you provide a link to a page demonstrating the problem, no one will be able to offer much in the way of assistance.

  3. desingenia
    Member
    Posted 1 year ago #

    Excuse me I must have forgot, you can see an example at the following link http://www.desingenia.com/las-claves-del-inbound-marketing-el-contenido-es-el-rey/
    With IE and Chrome you would be able to see broken link images where default avatar is supposed to be, whilst with Firefox no image appears whatsoever.
    Thanks, Adrian.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    That looks like an issue with your theme - assuming that you aren't using any kind of comment plugin. Try switching to the Twenty Eleven theme temporarily to confirm this.

  5. desingenia
    Member
    Posted 1 year ago #

    At first it does seem to be a theme issue, since avatars show correctly with Twenty Eleven theme, although after running through the code and making some tests I can say the following:

    On our actual Performs template the html code generated on the post for the default avatar is http://0.gravatar.com/avatar/a4a821503581340b2193963f23105f17?s=52&d=52&r=G, where both s and d parameters have value 52. This URL does not link to any image. Funnily enough the previous URL written with "&amp" (as written in html code) instead of "&" does link OK to the image (adding amp; just after each of &), and also if we do not fill in d value for the first URL case it also links OK without using "&amp" http://0.gravatar.com/avatar/a4a821503581340b2193963f23105f17?s=52&d=&r=G. In quite a strange way this only happens with default avatar, since my personal avatar is linking OK using the first structure http://1.gravatar.com/avatar/925a3648f52be555c917d612e58a97b1?s=52&d=52&r=G, which leaves me quite astonished. !!??

    The only relevant difference when using Twenty Eleven template would be the html code generated which for default avatar is http://0.gravatar.com/avatar/a4a821503581340b2193963f23105f17?s=68&d=&r=G. In this case d has no value, and just for testing matters if we were to assign d a value as in Peforms template, obviously it doesn't link
    http://0.gravatar.com/avatar/a4a821503581340b2193963f23105f17?s=68&d=68&r=G.

    Conclusion : Using d value in URL in the case of default avatar (any other personal avatar works OK) produces an error, only that this error only occurs in the case of using plain text ("&amp" works OK).

    Which would be the best way to encounter this problem in your opinion? Even though the template php code could be changed to disable d value assignment, why is gravatar site correctly accepting exactly the same URL, but only if using "&amp" ? Doesn't this seem more like a text-code misinterpretation issue from gravatar service? In any case, in which php file should I look for the avatar code generation?
    Thanks!!

  6. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    What code is your current theme using to generate the gravatar image's src?

  7. desingenia
    Member
    Posted 1 year ago #

    Inside theme_function.php inside comment generation function there is the following php call:

    <?php echo get_avatar( $comment, 52, 52); ?>

    I guess the last two variables correspond to s and d variables at the end of the URL after making proceessing in get_avatar function. I have just deleted the second variable so now the code stays as:

    <?php echo get_avatar( $comment, 52); ?>

    Now anonymous avatars are showing correctly.

    I don't know if deleting this variable would lead to having any more troubles or issues, but the main issue of avatar showing is solved. Any other recommendations??

    Thanks,
    Adrian

Topic Closed

This topic has been closed to new replies.

About this Topic