All WordPress blogs should have favicons (the little icon that displays to the left of the website address in your browser screen). The default WordPress favicon just smacks of amateurism. And you’re not an amateur, right?
Fortunately, installing a favicon on your WordPress site is a piece of cake. And although there are plugins available that can do it for you, such a task definitely falls into the “you do absolutely not need to use a plugin to do this” category. After all, you want to keep your site lean and mean.
First of all, you will need a favicon. My site of choice is Favicon Generator and Gallery, where you can convert your own image files into favicons, or just select from their gallery. Once you have your favicon ready, upload it to your WordPress site via the Media Library and copy the image’s URL.
Next, add this simple code to your theme’s functions.php file:
function my_favicon() { ?>
<link rel="shortcut icon" href="yourimagepathgoeshere" >
<?php }
add_action('wp_head', 'my_favicon');
That’s it! The above function will place the link to your favicon in the appropriate place (i.e. between the <head></head> tags).
Creative Commons photo courtesy of ulterior epicure
Simply insert google maps into posts, sidebars and pages - show directions, streetview, provide image overlays and do it all from a simple button and comprehensive widget.
Find out more
Would you like to add Facebook comments, registration, 'Like' buttons and autoposting to your WP site? Well, The Ultimate Facebook plugin has got that all covered!
Find out more
No javascript required, no third part chat engine, just fully featured chat right in your own database on your own WP sites - couldn't be easier.
Find out more
Now there's no need to pay for a third party service to sign up, manage and send beautiful email newsletters to your subscriber base - this plugin has got the lot.
Find out more
If you're thinking about starting a paid, or just private, membership site then this is truly the plugin you've been looking for. Easy to use, massively configurable and ready to go out of the box!
Find out more
Fully integrated with the SEOMoz API, complete with automatic links, sitemaps and SEO optimization of your WordPress setup - this is the only plugin you need to help you rank your site number 1 on Google - nothing else compares.
Find out more
It's now incredibly easy to start your own Q&A site using nothing more than WordPress - The Q&A plugin simply and brilliantly transforms any site, or page, into a perfect support or Q&A environment.
Find out more
Out of all the WordPress ecommerce plugins available, MarketPress has got to be the winner - easy to configure, powerful functionality, multiple gateways and more. A simply brilliant plugin!
Find out more
Take, set and manage appointments and client bookings without having to leave WordPress. Appointments+ makes it easy.
Find out more
Why not just add in header.php?
Because that would be theme-dependent and break the ability to safely upgrade the theme without losing changes.
What Shawn said ;-)
“Next, add this simple code to your theme’s functions.php file:”
How is that also not theme dependent??
Anytime I see “theme’s functions.php file” I think “custom plugin”. I can’t imagine why anyone would put sitewide options in any theme files instead of a plugin, specifically because of the theme upgrade issues mentioned before.
…what Shawn said (again) ;-)
Perhaps I wasn’t clear enough, but the two best options are to put it in a plugin (as Shawn said), or place the code in a child theme’s functions.php (or equivalent) file.
Hi there, I’m pretty new at all this (In hindsight I probably shouldn’t have continued reading after “you’re not an amateur right?”) Anyway I tried follow the steps to add a favicon to my wordpress built site http://www.ishotmadrid.com and then suddenly the HTTP 500 (Internal Server Error)message appeared!! I can’t even access the admin backend of the site to rectify things. I’ve no clue what went wrong, any help is greatly appreciated!
If you change your theme will you lose your favicon? if so then its theme dependent. Also, what if a site uses a shared theme and they want a custom favicon?
Simon, as stated above, it sounds like the best solution would be to put the code in a plugin.
Tom – Thanks A Lot for your help on this one. I appreciate it. I see it shows on Firefox, and explorer but not Chrome. Any suggestions? Thanks again.
Not sure Harmony – as a Chrome user, I haven’t experienced this issue…sorry!
Hi Tom, Just added the code and my favicon path to the functions.php area and when I use Safari I see a new favicon…but not mine. When i log in with Chrome, there is no favicon at all. Any suggestions?
http://www.marioncharlotte.com
Did you make a backup of your theme’s files? If so, just revert to the backup copy.
If you didn’t, look in your logs for the specific error. 9 times out of 10 an issue like this is going to be a missing semicolon or PHP that doesn’t include the proper opening or closing tags.
The easiest tutorial! Thanks a lot!