I am new to Magento 2 and, to begin with, I try to change the header from default Magento_Theme. But I am stuck here.
I followed the doc to create my own theme in app/design/frontend/<my_vendor>/<my_theme_name>
.
This theme has Magento/blank as parent in theme.xml.
This seems to work well as I can define website theme to <my_theme_name>
in the admin panel.
Then, I tried to override the default Magento_Theme layout.
I copied vendor/magento/module-theme/frontend/layout/default.xml
into my theme folder under app/design/frontend/<my_vendor>/Magento_Theme/layout/default.xml
.
And to check if that worked, I tried to hide the Header, using the remove
attribute as following :
<referenceContainer name="header.container" remove="true">
.
This remove doesn't work, whereas it works well when I put the same remove attribute into the default.xml file from the Magento_Theme folder...
The thing is I don't understand why my theme layout seems to not take the priority over the Magento_Theme layout.
Could it be something about modules order in app/etc/config.php
?
I use php bin/magento cache:flush
to clear my cache after each modification.
Update : After seeing this stack exchange issue I tried to put
my custom layout under app/design/frontend/<my_vendor>/<my_theme_name>/Magento_Theme/layout/override/theme/Magento/blank/default.xml
but that didn't work either.