Friday, 3 May 2013

Adding Favicon To WordPress Admin Panel

Important: All scripts hosted on widcraft.googlecode.com don't work anymore because Google has blocked that SVN repository.

As I noted before, I recently migrated my WWE blog from Blogger To WordPress, and I'm having too much fun with all amazing WordPress features and plugins. Soon I'll post an article about some cool WordPress plugins so don't forget to subscribe to BWidgets (from your favorite feed reader or email updates).

Let's get back to topic. After adding a favicon to our WordPress blog, we notice that our favicon is not appearing in our blog's admin panel. It's good to add a favicon to your blog's admin panel. Also, it's more important if your blog's users are also allowed to write for your site.

I tried to add it to my blog's admin panel by editing php files via ftp, and I was lost in those heavy scripted files. But after few minutes, I was successful in changing my blog's admin panel's favicon. So it's start the tutorial:

  • Visit your WordPress hosting provides. For example, I bought mine from GoDaddy.
  • Now visit your file manager or ftp client. Below is a screenshot of my file manager:


  • In my hosting, webroot is my root folder. Upload your favicon image in this webroot folder or skip to next point if your favicon is already uploaded..
  • Now visit webroot/wp-admin/admin-header.php. Now, in admin-header.php search for following line:

<title><?php echo $admin_title; ?></title>

  • Post following code just below it:

<link rel="shortcut icon" href="FAVICON IMAGE URL" />

  • Don't forget to replace FAVICON IMAGE URL with your the link of your favicon. Just like following image:


Now save your file and that's it!! If you still can't see favicon then clear your browser's cache files or try another browser. More WordPress tutorials are coming soon. I'll post new things as soon as I'll explore them :)

Another Way:

JP shared another great way in comments to permanently add a favicon to your WordPress' Admin Panel. He posted following in the comments:

Are you editing Wordpress core files? I strongly discourage that. Any changes you make to core files will be overwritten when you update WordPress. Instead, put something like this into your theme's functions.php file, or into a custom plugin.

add_action('admin_head', 'show_favicon');
function show_favicon() {
echo '<link href="FAVICON IMAGE URL" rel="icon" type="image/x-icon">';
}

Code that you put in either of those two places will survive updates.
Important: Check our new website TricksPanda.com for WordPress tutorials, plugins and more.
 
Powered by Blogger.