12/13/2016 - 12:18 PM

Add a Favicon to your Blog

Add a Favicon to your Blog

//* Do NOT include the opening php tag shown above. Copy the code shown below.

Every blog deserves to have its own identity. You can add this identity by adding the favicon code in your header.php file, or you can make it easier for yourself by simply adding the following code in your functions.php file. 

// add a favicon to your
function blog_favicon() {
echo '<link rel="Shortcut Icon" type="image/x-icon" href="'.get_bloginfo('wpurl').'" />';
add_action('wp_head', 'blog_favicon');

<!-- Now whenever you are developing the theme, just upload the .ico file in the root folder where the blog is uploaded. You can also modify the file destination if you like. Often theme developers forget to change the URL of the favicon. This can eliminate another worry. -->