Word Press

How to Add a Favicon to your Blog or site in WordPress?

If you want to your favicon icon in your blog or site then just copy and paste below code in your function.php file

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

Note: Put your favicon.png file in your stylesheet directory uri path.

Advertisements

2 thoughts on “How to Add a Favicon to your Blog or site in WordPress?

Leave your comments

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s