cancel
Showing results for 
Search instead for 
Did you mean: 

Problem displaying favicon

SOLVED

Problem displaying favicon

I am encountering an issue when theming on Magento CLI 2.3.5-p1.
I want to customize the favicon.

During my first attempt I just drop a new icon on web folder and named it favicon.ico.
It works but only when I am on the customer login page (my theme inherits from blank). So that's the first issue : I want my icon to show on every pages.

Then I tried doing it with an image with custom name. It didn't worked at all. I don't know what to do I have followed EVERY tutorials.


Here is my theme arborescence :
|Violette
|-themeviolette
|---Magento_Theme
|-----layout
|-------default_head_blocks.xml
|-----web
|------favicon.ico
|---media
|---registration.php
|---theme.xml

My default_head_blocks.xml :

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<link src="Magento_Theme::vio.ico" rel="icon" sizes="16x16" type="image/x-icon" />
</head>
</page>



Thank you very much for saving me

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Problem displaying favicon

Hello Marcus, it turned out I did everything good, the problem was the line endings of my files (especially default.xml) which was CRLF and not LF. Changing fixed everything. Thank you for your answer ! 

View solution in original post

5 REPLIES 5

Re: Problem displaying favicon

Hi @vquitralvea2ba,

 

To override the default 16px x 16px favicon manually, please add your custom favicon.ico in the /Magento_Theme/web/directory:

 

1. Add your icons in the <your_theme_dir>/Magento_Theme/web/ directory.

2. In the <your_theme_dir>/Magento_Theme/layout/default_head_blocks.xml layout file specify the paths to the icons and their sizes.

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
   <head>
       <link src="Magento_Theme::favicon-32x32.png" rel="icon" sizes="32x32" />
   </head>
</page>

In order to apply these changes, clear the browse cache and the following directories on the server (do not delete the .htaccess file): 

- pub/static

- all directories under var

 

Hope this can help you! Let me know if you need further assistance. 

__________

If issue solved, Click Kudos & Accept as Solution.

LitExtension - #1 Shopping Cart Migration Expert

LitExtension helps store owners and agencies migrate all important data from one eCommerce platform to another accurately, securely and at the highest speed.

Visit website: http://litextension.com/

Re: Problem displaying favicon

Hello Marcus, it turned out I did everything good, the problem was the line endings of my files (especially default.xml) which was CRLF and not LF. Changing fixed everything. Thank you for your answer ! 

Re: Problem displaying favicon

Hi @vquitralvea2ba,

 

Great! Glad to hear that!

LitExtension - #1 Shopping Cart Migration Expert

LitExtension helps store owners and agencies migrate all important data from one eCommerce platform to another accurately, securely and at the highest speed.

Visit website: http://litextension.com/

Re: Problem displaying favicon

At first I have also faced the same of issue of Favicon showing on my website, but later the issue has solved automatically, and I think that the issue is caused by caches, after 24 hours when the cache issue is cleared, the issue solved right away. Now you can see on your own how the website look nice with the favicon. 

Re: Problem displaying favicon

Initially, I encountered the same issue with the Favicon not appearing on my website. However, the problem resolved itself over time. I believe it was related to caching, as the issue disappeared 24 hours later when the cache was cleared. Take a look for yourself, and you'll see how the website now looks great with the favicon.