Why isn't my favicon displaying despite adding it to the theme?

Why isn't my favicon displaying despite adding it to the theme?

simone11
New Member
4 0 0

Hi, I have added my favicon to the theme, but it isn't showing.

 

I tried adding this code from another solution in the community, but with no luck:

 

{%- if settings.favicon != blank -%}
    <link rel="shortcut icon" href="{{ settings.favicon | img_url: '32x32' }}" type="image/png">
  {%- endif -%}

 

My site is: okholmstudio.dk

 

Does anyone have a solution to this?

 

Replies 7 (7)

Team_OSC
Shopify Partner
157 18 23

Hi @simone11 ,

 

Did you upload your favicon image to the favicon section? And even then it is not visible?

simone11
New Member
4 0 0

Yes, I have uploaded the favicon. Image attached

Skærmbillede 2023-11-23 kl. 13.40.56.png

Team_OSC
Shopify Partner
157 18 23

Use this code:

 

 {%- if settings.favicon != blank -%}
      <link rel="icon" type="image/png" href="{{ settings.favicon | image_url: width: 32, height: 32 }}">
    {%- endif -%}

change img_url into image_url

 

simone11
New Member
4 0 0

How do I find the image url for the favicon?

Team_OSC
Shopify Partner
157 18 23

This is your code

 

{%- if settings.favicon != blank -%}
    <link rel="shortcut icon" href="{{ settings.favicon | img_url: '32x32' }}" type="image/png">
  {%- endif -%}

 

 

Replace your code with this

 

 

 {%- if settings.favicon != blank -%}
      <link rel="icon" type="image/png" href="{{ settings.favicon | image_url: width: 32, height: 32 }}">
    {%- endif -%}

 

then try to upload the favicon image.

simone11
New Member
4 0 0

It doesn't work... unfortunately

Team_OSC
Shopify Partner
157 18 23

Then try this,

1. upload the favicon image with the size of 32x32

2. copy the link of uploaded favicon image from the file

3. comment this line in theme.liquid

 {%- if settings.favicon != blank -%}
      <link rel="icon" type="image/png" href="{{ settings.favicon | image_url: width: 32, height: 32 }}">
    {%- endif -%}

3. paste this link

<link rel="icon" type="image/png" href="https://cdn.shopify.com/s/files/1/0015/8292/3812/files/Best-buy-tips-fav.jpg">

where in href attribute you just paste the copied image link and save it.

then check this is working or not.

If after this favicon will show then i have check your theme code for why favicon is not showing.