{"id":7420,"date":"2019-10-05T13:17:12","date_gmt":"2019-10-05T07:47:12","guid":{"rendered":"https:\/\/www.hiddentechies.com\/blog\/?p=7420"},"modified":"2019-10-09T10:56:14","modified_gmt":"2019-10-09T05:26:14","slug":"magento-2-add-custom-links-in-footer-links","status":"publish","type":"post","link":"https:\/\/www.hiddentechies.com\/blog\/magento-2\/magento-2-add-custom-links-in-footer-links\/","title":{"rendered":"Magento 2 &#8211; How to Add Custom Links in Footer Links"},"content":{"rendered":"<p>In this post I am going to explain how to add custom links in footer in Magento 2.<\/p>\n<p>Here, I am using my custom module \u2013 Ht_Mymodule<\/p>\n<p>First you need to add default.xml file in your extension and add below code in it.<\/p>\n<p>File Path: app\/code\/Ht\/Mymodule\/view\/frontend\/layout\/default.xml<\/p>\n<pre class=\"lang:default decode:true \">&lt;?xml version=\"1.0\"?&gt;\r\n\r\n&lt;page xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd\"&gt;\r\n    &lt;body&gt;\r\n        &lt;referenceBlock name=\"footer_links\"&gt;\r\n            &lt;block class=\"Magento\\Framework\\View\\Element\\Html\\Link\" name=\"custom-link\"&gt;\r\n                &lt;arguments&gt;\r\n                    &lt;argument name=\"label\" xsi:type=\"string\"&gt;About Us&lt;\/argument&gt;\r\n                    &lt;argument name=\"path\" xsi:type=\"string\"&gt;about-us&lt;\/argument&gt;\r\n                &lt;\/arguments&gt;\r\n            &lt;\/block&gt;\r\n        &lt;\/referenceBlock&gt;\r\n    &lt;\/body&gt;\r\n&lt;\/page&gt;<\/pre>\n<p>Clear the cache and cache for the result.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7421\" src=\"https:\/\/www.hiddentechies.com\/blog\/wp-content\/uploads\/2019\/10\/custom-footer-link.png\" alt=\"Magento 2 - How to Add Custom Links in Footer Links\" width=\"1082\" height=\"246\" srcset=\"https:\/\/www.hiddentechies.com\/blog\/wp-content\/uploads\/2019\/10\/custom-footer-link.png 1082w, https:\/\/www.hiddentechies.com\/blog\/wp-content\/uploads\/2019\/10\/custom-footer-link-300x68.png 300w, https:\/\/www.hiddentechies.com\/blog\/wp-content\/uploads\/2019\/10\/custom-footer-link-768x175.png 768w, https:\/\/www.hiddentechies.com\/blog\/wp-content\/uploads\/2019\/10\/custom-footer-link-1024x233.png 1024w, https:\/\/www.hiddentechies.com\/blog\/wp-content\/uploads\/2019\/10\/custom-footer-link-800x182.png 800w\" sizes=\"(max-width: 1082px) 100vw, 1082px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Now if you want to add links from template file then add below code in default.xml<\/p>\n<pre class=\"lang:default decode:true \">&lt;referenceBlock name=\"footer_links\"&gt;\r\n\t&lt;block class=\"Magento\\Framework\\View\\Element\\Html\\Link\" name=\"custom-link-template\" template=\"Ht_Mymodule::footer-links.phtml\" after=\"-\" \/&gt;\r\n&lt;\/referenceBlock&gt;<\/pre>\n<p>Next to that, create footer-links.phtml template file.<\/p>\n<p>File Path: app\/code\/Ht\/Mymodule\/view\/frontend\/templates\/footer-links.phtml<\/p>\n<pre class=\"lang:default decode:true \">&lt;li class=\"nav item\"&gt;\r\n    &lt;a href=\"#\"&gt;\r\n        &lt;?php echo __('About Us') ?&gt;\r\n    &lt;\/a&gt;\r\n&lt;\/li&gt;<\/pre>\n<p>Now, Clear the cache and cache for the result.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post I am going to explain how to add custom links in footer in Magento 2. Here, I am using my custom module \u2013 Ht_Mymodule First you need to add default.xml file in your extension and add below code in it. File Path: app\/code\/Ht\/Mymodule\/view\/frontend\/layout\/default.xml &lt;?xml version=&#8221;1.0&#8243;?&gt; &lt;page xmlns:xsi=&#8221;http:\/\/www.w3.org\/2001\/XMLSchema-instance&#8221; xsi:noNamespaceSchemaLocation=&#8221;urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd&#8221;&gt; &lt;body&gt; &lt;referenceBlock name=&#8221;footer_links&#8221;&gt; &lt;block&#8230; <\/p>\n<div class=\"actions\"><a href=\"https:\/\/www.hiddentechies.com\/blog\/magento-2\/magento-2-add-custom-links-in-footer-links\/\">Continue Reading<\/a><\/div>\n","protected":false},"author":1,"featured_media":7452,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[59],"tags":[10,27],"_links":{"self":[{"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/posts\/7420"}],"collection":[{"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/comments?post=7420"}],"version-history":[{"count":1,"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/posts\/7420\/revisions"}],"predecessor-version":[{"id":7422,"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/posts\/7420\/revisions\/7422"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/media\/7452"}],"wp:attachment":[{"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/media?parent=7420"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/categories?post=7420"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hiddentechies.com\/blog\/wp-json\/wp\/v2\/tags?post=7420"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}