Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Change favicon.ico for Quark in Grav

Solved by pamtbaau View solution

Started by Martin Brampton 4 years ago · 2 replies · 2158 views
4 years ago

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?

4 years ago Solution

@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:

TWIG
<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
last edited 02/09/22 by pamtbaau

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 60 15 hours ago
Support · by Anna, 3 days ago
2 66 18 hours ago
Support · by Justin Young, 19 hours ago
1 33 19 hours ago
Support · by Duc , 1 week ago
2 69 6 days ago
Support · by Colin Hume, 1 week ago
2 61 6 days ago