Gravatar Problem Fix

While I had the option set to display the Mystery Man for people who aren’t registered on Gravatar.com, it never displayed correctly on drivelocity.com. Rather than showing whatever I had selected, the Gravatar logo would be displayed. There is an issue with WordPress themes and the code used to display gravatars that have left many people wondering what’s going on and how to fix it… Here’s how:

  1. Open your theme’s comments.php file
  2. Find the line that calls for the Gravatar
  3. Check to see if it uses “get_avatar”
  4. If not, replace it with the following code:

<?php echo get_avatar( $comment, $size = ’40′ ); ?>

This will enable it to use the Admin settings. The only variable you may need to change here is the size of the Gravatar. Ratings & default Gravatar are Admin settings under Settings>Discussion and spacing/style issues are located in your css file(s). Like anything, save a backup copy of any files you edit in case you need to revert to them later.

  • http://www.kiwibloke.org GregR

    Cheers good tip, I am a big fan of gravatars. It makes it easier to see the regular commentators and praise them individually.

    GregR´s last blog post..More Kiwi Pavlova Goodness with Pavlova Entrepreneurs (Video)

  • http://drivelocity.com drivelocity

    Greg, Thanks. I enjoy sharing info like this that can help other people. :)

  • http://www.grafixsolutions.biz Rick

    Thanks for sharing a good trick of Gravatars logo.
    Its makes easier to blogger to find regular commentator.

    Rick