Tip: Favicon Function

If you have a favicon you want to add to your WordPress powered blog, you can simply add a function to your functions.php file from inside your theme directory.

Here is the snippet:

{code type=php}
* FAVICON
* @WPCult.com
*/
function my_favicon() { ?>

‘/images/favicon.ico” />

add_action('wp_head', 'my_favicon'); ?>
{/code}

Please note that you have to add a favicon in .ico format (or .gif / .png) and you have to upload that to your theme directory inside the /images/ folder. If you have located the favicon somewhere else, please do correct the href path.

Snipped build by WPCult.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Design Float
  • DZone
  • StumbleUpon
  • TwitThis

This article is written by:

Name: Stefan Vervoort

URL: http://www.wptoy.com/

Description: I am Stefan Vervoort, WordPress enthusiast from the Netherlands. I also write for DivitoDesign.

Comments are closed.