Skip to content

Instantly share code, notes, and snippets.

@dipakcg

dipakcg/functions.php

Last active Aug 29, 2015
Embed
What would you like to do?
WordPress - Use Gravatar image as WordPress favicon
<?php
// Add the following code in theme's functions.php file to use Gravatar image as favicon (16x16 favicon.ico)
function dcg_gravatar_favicon() {
// Replace email here
$GetEmailHash = md5(strtolower(trim('me@dipakgajjar.com')));
?>
<link rel="shortcut icon" href="<?php echo 'http://www.gravatar.com/avatar/' . $GetEmailHash . '?s=16;'; ?>" type="image/x-icon" />
<?php
}
add_action('wp_head', 'dcg_gravatar_favicon');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment