Jump to content

Recommended Posts

Posted

I have added favicon files (.png, .xml, .ico, .svg) into site/templates/images/favicon/ folder. I refer to them in _after.php, <head> tag. Problem is that favicon does not show. When I go to the address of the .png icon, it shows the basic blue icon with question mark = something is wrong. But when I check .svg file, it shows correctly. Browser console and ProcessWire error log don't recognize any issues. All files have chmod 644, and all folders 755. All images added into site through ProcessWire admin are displayed correctly.

What could be the caused of this issue?

Posted

Hey iipa,

Just curious, how are you calling the file in your template? I have used the following without issue in the past. 
 

<link rel="icon" type="image/png" href="<?php echo $config->urls->templates?>/favicon.png" />

 

Posted
11 hours ago, Gideon So said:

Hi @louisstephens,


<link rel="icon" type="image/png" href="<?php echo $config->urls->templates?>favicon.png" />

There is no need to add a splash before favicon.png.

Gideon

You are correct gideon! I missed the typo in that one. 

  • 2 months later...
Posted

Hi louis, Gideon and szabesz - long time no see! ?

My syntax is same as yours, but somehow it still doesn't load it. I'm thinking it might be because I didn't load favicon through ProcessWire, I just put the image in server through SFTP. Testing still continues, since I've been busy with other things.

Suggestions of cause are still welcome, and I will post if I find the solution myself!

Posted

Hello, well I have not too much new ideas, but I can describe how I normally do it. I go to https://realfavicongenerator.net/ to upload my png and generate the code. I always use a subfolder in the siteroot, I call it /bicons for example:

<link rel="apple-touch-icon" href="/bicons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/bicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/bicons/favicon-16x16.png">
<link rel="manifest" href="/bicons/site.webmanifest">
<link rel="mask-icon" href="/bicons/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="/bicons/favicon.ico">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-config" content="/bicons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">

Sure, images are not in the templates directory in my case but that should not matter, I guess.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...