Quantcast
Channel: WordPress Experts
Viewing all articles
Browse latest Browse all 33

How to Use Your Gravatar as a Favicon On Your WordPress Blog!

$
0
0

gravatorA favicon (short for Favorite icon), also known as a shortcut icon, Web site icon, URL icon, or bookmark icon, is a file containing one or more small icons, most commonly 16×16 pixels, associated with a particular Web site or Web page.

A web designer can create such an icon and install it into a Web site (or Web page) by several means, and graphical web browsers will then make use of it. Browsers that provide favicon support typically display a page’s favicon in the browser’s address bar and next to the page’s name in a list of bookmarks.

It doesn’t matter what kind of site you have, you absolutely need a favicon. It identifies your site within the the browser’s address bar and tabs, as well as serving as the icon when someone bookmarks your site. You really don’t want to leave this as the default icon, because you’ll miss out on a chance to brand for your site.

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 address 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!

The post How to Use Your Gravatar as a Favicon On Your WordPress Blog! appeared first on WordPress Experts.


Viewing all articles
Browse latest Browse all 33

Trending Articles