Adding a Favicon: The Proper Way

StevenWordPress

If you want your blog to appear professional and to be taken seriously by your peers, there is a number of basic steps you must take, including having your very own favicon. Of course, you could easily add a favicon by editing your header.php file and adding some code there, but it’s not really a clean way to do that.

To add a favicon to your WordPress blog the proper way, you should paste the following code in the functions.php file of your WordPress theme:

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

Make sure you edit the url to the favicon file, for the favicon to be displayed properly.

Learn how I made $33,543 online in the past 12 months.

Simply input your best email below to get started.

Learn how I made $33,543 online in the past 12 months.

Simply input your best email below to get started.

No thanks, I have enough money