/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php echo '<img src="' . $gravatar_link . '" />'; ?> The variable "$comment_author_email" would be a string of a valid email address. If the email isn't in the Gravatar database, it will return a default graphic. "$comment_author_email" is the default WordPress variable that populates from a cookie for people who have previously commented (if the theme supports it).
URL: http://css-tricks.com/snippets/php/display-a-user-gravatar-from-email-address/