4

I have created one module and theme, theme extend to magento blank.I am trying to remove the header part in app/design/frontend/Gworks/Gtheme/Magento_Theme/layout/default.xml. But none of changes in my page. Please any help to dictate where I did mistake

below one is my dafault.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <remove name="header.container"/> </body> </page>

Magento Blank theme dafault.xml path vendor/magento/theme-frontend-blank/Magento_Theme/layout/default.xml

at the same time how to add new header?

8

You have to add below code in default.xml file,

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
  <body> 
      <referenceBlock name="header.container" remove="true" />  
  </body> 
</page>

Put above code and remove var folder its working fine.

| improve this answer | |

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