1

According to devdocs of magento 2.3.0 I tried to add a favicon manually.

https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/themes/favicon.html

Attempt 1:

/magento2/app/design/frontend/Magento GJ/theme-GJ/Magento_Theme/layout => here goes the default_head_blocks.xml file

<?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::favicon_32x32.png" rel="icon" type="image/x-icon" sizes="32x32"/>
    </head>
</page>

/magento2/app/design/frontend/Magento GJ/theme-GJ/Magento_Theme/web => here goes the favicon_32x32.png file

=> This works only in Firefox!

Attempt 2:

Then I tried just for fun to add in the root directory my own favicon.ico.

/magento2/app/design/frontend/Magento GJ/theme-GJ/Magento_Theme/

=> This works for Safari, Chrome and Edge. The IE does not work.

Attempt 3:

According to the magento 2.3.0 bug to add a favicon over the backend I solved this issue also:

Magento 2.3 favicon and logo upload does not take hold

Then I tried to upload my favicon. => All browsers can handle the favicon.

I want to know why the first attempt does not work for all browsers? - I am at a loss :/

3 Answers 3

0

Magento favicon icon with type="image/x-icon" should be of file type .ico, in your case you used a .png instead and that makes it behave abnormally.
To validate it, try using a favicon.ico file

0
0

Solution: The .ico file need to be under <vendor>/<theme>/web/ directory. Without the .ico file the .png images are not working on every browser.

0

After updating to Magento 2.4.6 enterprise edition, in chrome (and only in chrome) the default Adobe favicon was showing instead of the custom one.

I solved by creating Magento_Enterprise/web/favicon.ico inside app/design/frontend/<vendor>/<theme>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.