How to Add a Custom Footer to Magento 2 Theme

footermagento2templatetheme

My theme inherits from Blank. I know how to remove the footer links: Contact us, Advanced Search, etc… then I'd like to add a custom footer with 4 columns:

column 1 – Account links
column 2 – general information links
column 3 – Payment logo icons
column 4 – Newsletter sign up form

All elements would be in a footer.phtml template, however I dont know how to add this phtml file to the footer area.
And which folder this file should be located in? I know how to override templates, but the Blank theme does not have a footer.phtml enabled, so there is no a specific path to put my phtml file in.

Best Answer

In default.xml from module Magento\Theme add this code inside footer referenceContainer

<block class="Magento\Cms\Block\Block" name="block-footer" after="footer_links">
      <arguments>
            <argument name="block_id" xsi:type="string">block_footer_custom</argument>
      </arguments>
</block>

Goto backend Content > Blocks > Add new static block with identifier name block_footer_custom with any html code you need. It so easy to editable Clear cache and re-deploy static. Now you will get your custom block

====UPDATE====
Call block inside template

<?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('block_footer_custom')->toHtml();?>
Related Topic