how to add a favicon to your wordpress blog

We all know what is favicon logo. WordPress tutorial, how to add a favicon to your wordpress blog. In wordpress theme you can easily add the favicon logo using following code and put in functions.php file

how to add a favicon to your wordpress blog

you just need to open your functions.php file and put following code in that file.

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

Note: your favicon.ico file need to placed under theme->images folder. then only this code will work