I have seen similar questions on this site, but all of them were dealing with different languages.
I have a website I am designing in WordPress, and I want to set a favicon for it. If I have the desired icon in a designated location on the site, can I set the favicon with PHP alone, and how would I do it?
echo this in the
<head></head>
section:For WordPress
Add this line:
<link rel="icon" href="http://example.com/favicon.ico" type="image/x-icon">
intoheader.php
from your templateYou dont have to use php:
yes you can. just embed you html in that php file:
Note: this line should be applied into
<head></head>
elements block to get work it.Using only PHP – not, you can’t.
You have to use
echo
command for HTML tags in webpage’s<head>
section, which are showing a favicon. That’s all.Please read also: http://codex.wordpress.org/Creating_a_Favicon