I am new to magento 2.I want to use custom header and footer design for my site but don't where to keep that code. I am using blank theme. Please help me. Thanks in advance.

1 Answer 1


Add custom header:


<referenceContainer name="page.wrapper">
    <block class="Magento\Framework\View\Element\Template" name="custom_header" template="Magento_Theme::html/header.phtml" before="main.content">

Add the header template to:


Add custom footer:


<referenceContainer name="footer-container">
    <block class="Magento\Framework\View\Element\Template" name="custom_footer" template="Magento_Theme::html/footer.phtml">

Add the footer template to:


  • How to add CSS for the header and footer?
    – zus
    Dec 1, 2020 at 6:41

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.