Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
WordPress - Use Gravatar image as WordPress favicon
// 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('')));
<link rel="shortcut icon" href="<?php echo '' . $GetEmailHash . '?s=16;'; ?>" type="image/x-icon" />
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