Add Gravatar Hovercards to Your WordPress Blog

While my commenting system of choice is Disqus, however there are some people I know, who for whatever reason, don’t like Disqus and still use WordPress’ native commenting system to handle their blog’s community. This tip is for all of you.

If you are using WordPress native comments your blog already supports people’s Gravatars by identifying their email address as they comment. Well WordPress is rolling out a new feature for Gravatar called Hovercards, which is a cool feature that allows you to see more of how people are interacting socially. While the official plugin is still in the works, Otto on WordPress came up with a temporary plugin solution for those of you that can’t wait.

Otto actually wrote code that creates and calls in a plugin but since it’s unsupported for now we’re going to skip the plugin code and just edit a line in your functions.php file since that doesn’t require you to even FTP anything.

In your WordPress Dashboard go to Appearance > Editor and choose your theme and then click on the functions.php file in the right. You should see the file show up in the editor and once you do just add this line of code to the bottom of it:

wp_enqueue_script( 'gprofiles', '', array( 'jquery' ), 'e', true );

Once you’re done, hit the Update File button and you’re done. The next time someone leaves a comment connected to their Gravatar account you’ll be able to hover over it and find out a lot more about the people leaving comments on your blog.

Special thanks to Otto and Alex for coming up with this quick fix for those of you who can’t wait until the official plugin is out.

Note: once the official plugin is release and you install it, be sure to go back in to your functions.php file and remove the line of code you added to make sure there aren’t any wires crossed.


2 thoughts on “Add Gravatar Hovercards to Your WordPress Blog

  1. Thanks for the info James! Clear directions and instructions. Does it work for those who left past comments? Not sure if its working on my blog? Guess I’ll find out soon enough. Also, do you know if I am using the Disqus commenting system – is this automatically linked up to your gravatar? Thanks again!

    • Hi Paul, sorry it took me so long to respond to this. And I’m not sure it works with Disqus.

      Disqus does support Gravatars though, if you haven’t uploaded a profile pic to Disqus it will use your Gravatar pic that is associated with your email address.

      If you’re using Disqus though you really don’t even need to worry about Hovercards anymore anyway. Once someone leaves a comment on your blog using Disqus comments you can click on their profile pic and see their entire profile along with all the other information that Hovercards were originally meant to provide.

      Hope that helps.


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s