Connect with us

Tips & Tricks

Adding a favicon to your site

Looking to add a favicon to you site?

Inside your WordPress theme’s functions file (functions.php) add the following to inside your PHP code.

/**
 * FAVICON
 * @WPCult.com
 */
function my_favicon() { ?>
	<link rel="shortcut icon" href="<?php echo bloginfo("stylesheet_directory") ?>'/images/favicon.ico" />
<?php }

add_action('wp_head', 'my_favicon');

That’s it, just be sure to upload an icon image or a .gif/.png. Be sure to correct the target location id the file is located somewhere else.

8 Comments

8 Comments

  1. Peter

    April 2, 2009 at 11:37 pm

    The backstory on why it’s traditionally a .ico (instead of .gif or .jpg) is actually pretty interesting – you can read up on it on this wikipedia entry:

    http://en.wikipedia.org/wiki/Favicon

    Ok, so maybe its only interesting to me :).

    Peter´s last blog post..Creating User Friendly Custom Fields by Modifying the Post Page

    • Austin

      April 3, 2009 at 10:00 am

      Yeah, I’ve read it. Though with more browsers supporting it, I typically like to use transparent png’s these days.

  2. Pingback: Tip: Favicon Function « WP TOY

  3. Pingback: WordPress articles for 03.04.09 | WPStart.org - WordPress themes, plugins and news

  4. Searchgo

    April 18, 2009 at 1:24 pm

    Thanks great post.

  5. Matthew Coleman

    April 27, 2009 at 1:17 pm

    Is there a benefit to doing it this way, instead of just adding into the header.php?

  6. mktanny

    October 29, 2009 at 4:13 pm

    Moved from blogspot to wordpress and then was searchinhg for a way to add favicon to my blog then got here thnx.
    How To Add Favicon To Your Blogspot Blog

You must be logged in to post a comment Login

Random Search Terms

Title

Top Articles

Top Searches

powered by WassUp

Recent Posts: Fully Net Worth . com

Sasha Velour Net Worth: How Rich is the Drag Queen Actually?

Sasha Velour Net Worth: How Rich is the Drag Queen Actually?

Alexander Hedges Steinberg also known by the stage name Sasha Velour is an American drag queen and artist. Velour is best known for winning the 9th season of RuPaul’s Drag Race. As of 2019, Sasha Velour net worth is estimated to be $2.5 million. Velour was born on June 25, 1987, in Berkeley, California as the only child of Mark […]

Laganja Estranja Net Worth: How Rich is the Drag Queen Actually?

Laganja Estranja Net Worth: How Rich is the Drag Queen Actually?

Jay Evan Jackson also known by Laganja Estranja is an American choreographer and drag queen. She is best known for competing in the sixth season of RuPaul’s Drag Race where she finished eighth. As of 2019, Laganja Estranja net worth is estimated to be $1.5 million. Laganja was born on December 28, 1988, in Dallas, […]

Alison Hammond Net Worth: How Rich is Hammond Actually?

Alison Hammond Net Worth: How Rich is Hammond Actually?

Alison Hammond is an English television personality who is known for presenting ITV’s ‘This Morning’ as the showbiz reporter. As of 2019, Alison Hammond net worth is estimated to be $1.5 million. Hammond was born on February 5, 1979, in Birmingham, England. Her father is Nevisian and her mother is Guyanese. Before she became famous she was a […]

%d bloggers like this: