Magento – How to add footer link in magento 2

custom-themefooter-linksmagento-2.1

I have created block title Footer Links Block and block identifier footer_links_block and added bellow code into block.

<div class="row">
<div class="col-sm-9 pad_right">
<div class="qucik_link">
<div class="sitemap">
<ul class="footer_link">
<li><a> Quick Links</a>
<ul>
<li><a title="About Us" href="{{store url="about-als"}}" target="_self">About Us</a></li>
<li><a href="{{store url="become-a-carepartner"}}">Become a Care Partner</a></li>
<li><a title="Article" href="{{store url="article"}}" target="_self">Knowledge Centre</a></li>
<li><a href="{{store url="latest-offers"}}">Latest Offers</a></li>
<li><a title="News &amp; Article" href="{{store url="news"}}" target="_self">News &amp; Articles</a></li>
<li><a title="FAQ" href="{{store url="faq"}}" target="_self">FAQs</a></li>
{{block class="Als\ThemeExt\Block\TrackLink" template="Als_ThemeExt::tracklink.phtml"}}
<li><a href="{{store url="contact-us"}}">Contact Us</a></li>
</ul>
</li>
</ul>
</div>
<div class="sitemap">
<ul class="footer_link">
<li><a> Shop by</a>
<ul>
<li><a href="{{store url="ruminants.html"}}">Ruminants</a></li>
<li><a href=" {{store url="Pets.html"}}">Pets</a></li>
<li><a href=" {{store url="equines.html"}}">Equines</a></li>
</ul>
</li>
</ul>
</div>
<div class="sitemap">
<ul class="footer_link">
<li><a> Our Policies</a>
<ul>
<li><a href=" {{store url="terms-and-conditions"}}">Terms and Conditions</a></li>
<li><a href=" {{store url="privacy-policy-cookie-restriction-mode"}}">Privacy Policy</a></li>
<li><a href=" {{store url="shipping-returns-cancellation"}}">Shipment</a></li>
<li><a href=" {{store url="order-cancellation"}}">Order Cancellation</a></li>
<li><a href=" {{store url="replacement"}}">Replacement</a></li>
<li><a href="{{store url="disclaimer"}}">Disclaimer</a></li>
<li><a href="http://amaruventures.co.in/demo1/als_demo/compliance">Compliance</a></li>
</ul>
</li>
</ul>
</div>
<div class="sitemap">
<h3>Call us for any assitance <strong>1800-212-5500</strong></h3>
<div class="social_icon">
<h3>Follow us on</h3>
<ul>
<li><a href="https://www.facebook.com/alsvetcarecom-321977024847350 "><i class="fa fa-facebook"></i></a></li>
<li><a href="https://www.twiter.com/alsvetcare/"><i class="fa fa-twitter"></i></a></li>
<li><a href="https://www.linkedin.com/company/alsvetcare.com"><i class="fa fa-linkedin"></i></a></li>
<li><a href="https://www.instagram.com/alsvetcare/"><i class="fa fa-instagram"></i></a></li>
<li><a href="https://plus.google.com/+alsvetcare"><i class="fa fa-google-plus"></i></a></li>
</ul>
</div>
</div>
<div class="clearfix"></div>
</div>
</div>
<div class="col-sm-3">
<div class="shipping_data">
<ul>
<li><span><i class="fa fa-inr"></i></span> Cash on Delivery*</li>
<li><span><i class="fa fa-undo"></i></span> 3 Days Return*</li>
<li><span><i class="fa fa-truck"></i></span> Free Shipping*</li>
</ul>
</div>
</div>
</div>

after that add fallowing code in app\design\frontend\Magenticians\Mytheme\Magento_Theme\layout\default.xml

<referenceContainer name="footer-container">
    <container name="footer-top" label="Footer Top" htmlTag="div" htmlClass="quick_bg" before="-">
    <container name="footer-top-container" label="Footer Top Container" htmlTag="div" htmlClass="container" before="-">
    <block class="Magento\Store\Block\Switcher" name="store_switcher" as="store_switcher" template="switch/stores.phtml"/>
    <block class="Magento\Cms\Block\Block" name="footer_links_block">
        <arguments>
            <argument name="block_id" xsi:type="string">footer_links_block</argument>
        </arguments>
    </block>
    </container>
    </container>
</referenceContainer>

after that ran all CLI command. but its not working for me.

Best Answer

  <referenceBlock name="footer_links" remove="true" />
  <referenceBlock name="form.subscribe" remove="true" /> 

1. Add Above Code in

app\design\frontend\Magenticians\Mytheme\Magento_Theme\layout\default.xml

2. Go to Content > Widgets > Add Widget

a. Select Type > CMS Static Block | Desgin Theme > Your Theme => Click Continue

b. See "Layout Updates" Tab in Storefront Properties:

      i. Display On : All Pages
     ii. Container : CMS Footer Links 

c. Go to Widget Option and select your Block.

Related Topic