Point Gravatars to their respective sites

  • May 11th, 2006

Paul Stamatiou does the grunt and provides a little code snippet for improving a Gravatar enabled blog. By default, the gravatar plugin redirects clicks to Gravatar.com. A simple copy n’ paste will have Gravatars on your site redirected to their respective authors page.

<?php if (function_exists('gravatar')) { ?><a href="<?php comment_author_url(); ?>" title="<?php comment_author(); ?>'s website"><img src="<?php gravatar("X", 32, ""); ?>" class="gravatar" alt="Gravatar Icon" /></a><?php } ?>

The key calls being comment_author_url and comment_author. Whodathunk?