Having problems displaying favicon in codeigniter. Title shows the code instead - html

<link rel="icon" type="image/x-icon" href="<?php echo base_url().'favicon.ico'?>">Project name</title>
I have placed favicon.ico in the root folder.
But when trying to browse the page title shows the code instead with the entire link tag.
Lost of ideas on what to do.

Solution 1:
<link rel="icon" href="<?php echo base_url(); ?>favicon.ico"> <title>Project Name. </title>
Turn's out OP wrapped into <title></title>, which causing it not working.
Solution 2:
put your favicon.ico to your project root folder, then use href="favicon.ico"

Related

Browser tab icon is not showing up

I am making a website and there is an error.
It won't show the website icon.
Proof: https://i.stack.imgur.com/053Xh.png
Code:
<link rel="icon" href="images/favicon32.ico" type="image/x-icon"
You are not closing the link tag add this " /> " at the end
<link rel="icon" href="images/favicon32.ico" type="image/x-icon" />
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
Do the following things.
Please close you link tag by adding "/>"
For good practice, first move favicon in main/root folder, not in inner folders, to load it fast
Change your favicon file name into "favicon" and its extension must
be "ico" not icon. Please see the file name carefully.

Is there a way to use directories in html?

I am trying to write a simple HTML page and I want to put my css and my favicon in another folder, put this does not work.
<link rel="shortcut icon" type="image/x-icon" href="../other/home.ico" />
<link rel=stylesheet href="../other/home.css" />
when I use this code, it doesnt find the right file even though i think it is the right way to write it.
my HTML file is in the folder: (E:\website\transendence) while my css and favicon is in: (E:\website\other)

Favicon ico doesn't work

<link rel='shortcut icon' href='img/favicon.ico'>
The above line is inside head part of page.
favicon.ico is inside img folder.
Doesn't work in Firefox and Chrome.
I restarted browsers, cleared the cache many times...
Any suggestion.
I also tried:
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
You forgot to self-close the link tag.
I think it is recommended to use double quotes as well:
<link rel="shortcut icon" href="img/favicon.ico"/>
If this doesn't work, have you tried to actually access the favicon image by typing the url like: http://example.org/img/favicon.ico to make sure it is reachable ?
Try using:
<link rel="icon" type="image/x-icon"
href="image/favicon.ico"/>
without the "shortcut"
if that doesn't help, you might find something in this
Wikipedia article on favicon
If any of the other answers don't work, just put ! in front of the tag.

How to add favicon on newly created web page through notepad?

I have made a webpage through notepad. And want to have a "faveicon" but can't add it.
Here's my html's head part:
<link rel="shortcut icon" href="/favicon.ico"/>
after title part i typed this in head.
This worked for me..
<link rel="shortcut icon" href="/images/specialicon.ico" type="image/x-icon" />
Just check this url.. it will helpful to you..
Just add the following in your HEAD section, remember to change type and href:
<link rel="icon" type="image/png" href="http://example.com/myicon.png">
You can make a 16x16 png and then use
<link rel="shortcut icon" href="/favicon.png" type="image/png">
<link rel="shortcut icon" type="image/png" href="http://www.example.com/favicon.png" />
If you place a favicon in the root folder of your website called "favicon.ico" then it will work!
By putting the image in the same folder where my web page was located and writing this code it worked :)
<link rel="shortcut icon" href="h.ico">

Wordpress blog favicon problem

I am trying to upload a favicon in my wordpress site. I have followed every step correctly but still its not showing the favicon. Fisrt I converted my pic to favicon.ico . Then I uploaded it to my root directory. Then I added the following code to my header.php file in the <head> tag :
<link rel="shortcut icon" href="http://misspassiton.com.au/favicon.ico" />
I have tried this one as well
<link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/favicon.ico" />
I have also visited : http://codex.wordpress.org/Creating_a_Favicon
but nothing seems to be working. I dont know whats wrong with it. I would be grateful, if anyone could help me
Regards
Omayr.
It seems that your .ico file is corrupted. I can't open it in my browser. Other than that, it looks like you are doing everything ok.
If you can open http://misspassiton.com.au/favicon.ico directly in your browser, then you'll know it's working.
Requesting http://misspassiton.com.au/favicon.ico, it responds but seems that the image is broken. So the href is ok ;)
2 suggestions:
First: try to use a tool that
converts images in ico (i.e.
http://www.favicon.cc/)
Second: if you want to use
bloginfo(), you have to pass as
parameter 'url' because if you pass
'template_directory' it will return
'http://example/home/wp/wp-content/themes/parent-theme' that is completely wrong and as you can see it doesn't point to public root
(see the reference)
edit : add also type on the link (for IE)
<link rel="shortcut icon" href="http://misspassiton.com.au/favicon.ico" type="image/vnd.microsoft.icon" />
I was having the same problem. The code below worked. Add to the header.php file right before the end head tag. Your image should be in the root of your wordpress installation.
/* ADD FAVICON */
<link rel="icon" href="<?php bloginfo('siteurl'); ?>/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="<?php bloginfo('siteurl'); ?>/favicon.ico" type="image/x-icon" />