I’ve read everything I can find on setting a custom favicon, but try as I might, the default Grav favicon continues to be shown.
The theme is a child theme of Quark, and the custom favicon is in:
/user/config/themes/bsr-quark/images/favicon.ico
/user/themes/bsr-quark/images/favicon.ico
So far as I can tell, there is no other favicon.ico file within the site, so I don’t know what it is that is being used as favicon.
Is there a solution to this?
@counterpoint, If you take a look at the code of template /user/themes/quark/templates/partials/base.html.twig, you will see the following at line 16:
<link rel="icon" type="image/png" href="{{ url('theme://images/favicon.png') }}" />
Which means: Get url of file /images/favicon.png from the current theme.
In your case:
-
/user/config/themes/bsr-quark/images/ : Location is incorrect.
-
/user/themes/bsr-quark/images/ : Correct location to store the favicon.
-
favicon.ico : Incorrect filename and will not match above code snippet.
Two options:
- Use favicon.png, or
- Override template /user/themes/quark/templates/partials/base.html.twig in your own theme and change the filename used in line 16
2 Likes
Thanks very much for the clear answer.