Home » Labs » Display Gravatar Image as Favicon in WordPress  

Display Gravatar Image as Favicon in WordPress


Filed under Labs

If you want to use gravatar image as favicon then here is a fine solution, add following snippet to the functions.php in your WordPresstheme folder.

<?php 
function gravatar_favicon() {
        $GetTheHash = md5(strtolower(trim(get_bloginfo('admin_email'))));
        return 'http://www.gravatar.com/avatar/' . $GetTheHash . '?s=16';
}
function favicon() {
        echo '<link rel="Shortcut Icon" type="image/x-icon" href="'.gravatar_favicon().'" />';
}
add_action('wp_head', 'favicon');
?>

Posts you may like: