DISCLAIMER: this post is older than one year and may not be up to date with latest WordPress version.

Nowadays, any serious blog have its own favicon. To add yours into WordPress, you can directly edit header.php or you can use a more clean technique, using the power of WordPress hooks.

Just paste the following into your function.php file, save it, and you’re done.

function childtheme_favicon() { ?>
	<link rel="shortcut icon" href="<?php echo bloginfo('stylesheet_directory') ?>/images/favicon.png" > 
<?php }
add_action('wp_head', 'childtheme_favicon');

Don’t forget to change the favicon url if needed. Also, please note that if the wp_head() function haven’t been implemented in your theme, this recipe will not work.

By the way, if you’re looking for premium WordPress themes and plugins, just have a look to the dedicated category on CouponsForBloggers.com!



  1. You don’t need to echo ‘bloginfo()’ – if it was ‘get_bloginfo()’ you would.

  2. and as a rule it’s better to (i prefer to) close the link ‘/>’

    Other than that great info.

  3. I tried:
    function zombieicon() { ?>

    <?php }
    add_action('wp_head', 'zombieicon');

    and it didn't work for my plugin! please explain!

Leave a Comment

Your email address will not be published. Required fields are marked *