Set the favicon for all pages

advertisements

Following is the code to display favicon:

 <head>
<title><link rel="icon" href="/favicon.ico" type="image/x-icon" /></title>
</head>

path for my image is: wamp/www/widget_corp/favicon.ico

the url for page was: localhost/widget_corp/pat_apt.php

Problem is : I cannot display favicon . Can anyone tell me why? Also suggest me way to display favicon for all pages. I went through some forums,they suggested to edit config file. Is that true? I am using wamp server 2.4


Don't embed your favicon code in title tags. That's why you can't see it.

To include same code in various pages, create a php file to contain your head information:

header.php

<link rel="icon" href="/favicon.ico" type="image/x-icon" />

Then call it between head tags of all of your pages:

<head>
  <title>My Title</title>
  <? require_once 'header.php'; ?>
</head>