Specify favicon for use within WordPress Dashboard
One of my little peeves about WordPress is that a blog’s favicon disappears once you enter the WordPress Dashboard. A browser’s default behaviour upon landing on a website is to load favicon.ico from the root web directory for that website (i.e. http://www.mydomain.tld/favicon.ico), but if it is not there nothing is loaded. While dropping a favicon within the root web directory should be all that is required, sometimes specifying its location within your theme’s header.php is required to point browser’s in the right direction, but how can you do the same for the Dashboard? In this post, I will show you how you can make your favicon persistent in this location using functions.php.
Continuing with the recent posts on adding functionality to WordPress via functions.php, navigate to your theme’s files and, with a simple text editor, open the functions.php file. If one does not exist, create one and save it to your theme’s directory. Add the following lines of code and modify the domain reference to suit your setup and the location of your favicon. Save and re-enter your Dashboard to see the effects.
// Specify favicon for Dashboard
function favicon4admin() {
echo '<link rel="Shortcut Icon" type="image/x-icon" href="http://www.mydomain.tld/favicon.ico" />';
}
add_action( 'admin_head', 'favicon4admin' );
As usual, this is a per-theme modification, so you will need to reapply if you automatically update your theme or switch to another theme.

Nice.. I wanted this functionality, I searched, I found, I installed, it works, I tweeted.. Woohoo.. Thanks..
Sunny
21 June, 2011 at 7:21 PM