Reputation: 185
Following code is for displaying 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 the way to display favicon for all pages. I went through some forums they suggested to edit the config file. Is that true? I am using WAMP Server 2.4.
Upvotes: 1
Views: 8565
Reputation: 2104
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>
Upvotes: 3
Reputation: 14243
Use this:
<head>
<link rel="icon" href="../widget_corp/favicon.ico" type="image/x-icon" />
</head>
you should put only your page's title text in <title>
.
Upvotes: 3