Do you want to be able to use your gravatar as a favicon on your WordPress blog? That’s pretty easy to achieve with this trick. Enjoy!
Do you want to be able to use your gravatar as a favicon on your WordPress blog? That’s pretty easy to achieve with this trick. Enjoy!
First, edit the following function by adding your email adress on line 3, then paste it on your functions.php file.
function GravatarAsFavicon() {
//We need to establish the hashed value of your email address
$GetTheHash = md5(strtolower(trim('you@yourdomain.com')));
echo 'http://www.gravatar.com/avatar/' . $GetTheHash . '?s=16';
}
Once done, open the header.php file of your theme and paste this:
<link rel="shortcut icon" href="<?php GravatarAsFavicon(); ?>" /> <link rel="apple-touch-icon" href="<?php GravatarAsFavicon(); ?>">
Thanks to Adam Whitcroft for the cool tip!
4 Responses
Very easy to implement, thanks a lot Adam.
Thanks thats just a small job. For some reason the function GravatarAsFavicon() { part once copied to clipboard changed the () but i missed that , works!
NIce blog to!
The problem I have is when reducing my Gravatar to 16 by 16 pixels I get a fuzzy mess which doesn’t look good. Is there any way I could sharpen the image before using it as my favicon? I’m good with Photoshop but not that good.
if (!function_exists(‘insert_favicon’)) {
(insert_favicon);
}
function insert_favicon() {
echo ”;
}
add_action(‘wp_head’,'insert_favicon’, 1);
Trackbacks: