2

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.

2 Answers 2

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
  • I am using a blank theme on how to add header and footer
    – zus
    Commented Dec 1, 2020 at 6:33
-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
2
  • Your code is for Magento 1, the post is regarding Magento 2.
    – Ben Crook
    Commented May 25, 2017 at 14:09
  • Ooops sorry Commented May 25, 2017 at 14:13

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.