Magento 2 custom child theme add favicons
Ok, so the answer is that href
needs to be replaced with src
. Also you need to place or copy the normal favicon.ico file inside the theme_dir/web/
directory. All my other icons are in theme_dir/web/icons/
The following now works for me:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<!-- Custom Favicons -->
<link rel="apple-touch-icon" sizes="57x57" src="icons/apple-icon-57x57.png"/>
<link rel="apple-touch-icon" sizes="60x60" src="icons/apple-icon-60x60.png"/>
<link rel="apple-touch-icon" sizes="72x72" src="icons/apple-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="76x76" src="icons/apple-icon-76x76.png"/>
<link rel="apple-touch-icon" sizes="114x114" src="icons/apple-icon-114x114.png"/>
<link rel="apple-touch-icon" sizes="120x120" src="icons/apple-icon-120x120.png"/>
<link rel="apple-touch-icon" sizes="144x144" src="icons/apple-icon-144x144.png"/>
<link rel="apple-touch-icon" sizes="152x152" src="icons/apple-icon-152x152.png"/>
<link rel="apple-touch-icon" sizes="180x180" src="icons/apple-icon-180x180.png"/>
<link rel="icon" type="image/png" sizes="192x192" src="icons/android-icon-192x192.png"/>
<link rel="icon" type="image/png" sizes="32x32" src="icons/favicon-32x32.png"/>
<link rel="icon" type="image/png" sizes="96x96" src="icons/favicon-96x96.png"/>
<link rel="icon" type="image/png" sizes="16x16" src="icons/favicon-16x16.png"/>
<link rel="manifest" src="icons/manifest.json"/>
<!-- Custom Metas -->
<meta name="msapplication-TileColor" content="#ffffff"/>
<meta name="msapplication-TileImage" content="icons/ms-icon-144x144.png"/>
<meta name="theme-color" content="#ffffff"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
</head>
</page>