Simple Twitter Connect and Simple Facebook connect are two very useful plugins which let you integrate Twitter and Facebook modules into your WordPress site. One of these modules let users to comment on your WordPress site by logging in through Twitter or Facebook.  If you are new to these plugins, you might have encountered a particular issue, where instead of the profile pictures of Facebook or Twitter being shown beside the comment, Gravatar or default WordPress avatar is shown. This problem, however, does not occur in all the themes, especially the ones where the creator has properly passed the comment as a whole object.

The problem arises because of the theme narrowing down a particular get_avatar function to pass an email address instead of the whole comment. As a result, a Gravatar or any avatar  associated with that email address is shown. If the comment is passed on as a whole object, then get_avatar  knows how to deal with it in the best way, and the best way would be to show the profile picture.

How to Fix it?

  • Go to your current theme folder. (/wp-content/themes/CurrentTheme)
  • Open up Functions.php in code editor or any plain editor. (Remember to make a backup of it!)
  • Search for get_avatar
  • Now, you’ll see something similar to following :

<?php echo get_avatar( $comment->comment_author_email, 75 ); ?>

  • Replace it with :

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

  • Save the file.

I hope you have understood what you are doing here; you just have to remove the comment_author_email so that the get_avatar  function is not narrowed down to pass email address only.

Now, you will be able to see profile picture instead of Gavatar on the comment section.