1

I am creating new header.phtml and footer.phtml and store into app/design/frontend/<vendor_theme>/mytheme_name/theme_layout/template/html.

so how to add new header and footer in magento/blank theme.

3

You can overwrite the existing templates by copying them into your theme and making changes to the template files.

So copy these two files:

vendor/magento/module-theme/view/frontend/templates/html/header.phtml
vendor/magento/module-theme/view/frontend/templates/html/footer.phtml

Into your theme:

app/design/frontend/VENDOR/THEME/Magento_Theme/templates/html/header.phtml
app/design/frontend/VENDOR/THEME/Magento_Theme/templates/html/footer.phtml
-1

Change in xml

<default>
 <reference name="header">
      <action method="setTemplate"><template>page/html/Your_Custom_Header.phtml</template></action>
   </reference>
   <reference name="footer">
      <action method="setTemplate"><template>page/html/Your_Custom_Footer.phtml</template></action>
   </reference>
</default>

And

Placed Your_Custom_Header.phtml and Your_Custom_Footer.phtml in theme directory

app\design\frontend\Your_Theme\template\page\html\ Here
  • Your code is for Magento 1, the post is regarding Magento 2. – Ben Crook May 25 '17 at 14:09
  • Ooops sorry – shariq shahab May 25 '17 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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