Edit footer menu with layout

First, create a custom theme

1.  Create the folders and files you will need
app/design/frontend/theme/Name of the theme you created/Magento_Theme/{layout, templates}

2. To create a layout file through which we will add and delete menu sections.

app/design/frontend/theme/Name of the theme you createdMagento_Theme/layout/default.xml

3. Add the initial layout for default.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="footer_links">
            
        </referenceBlock>
    </body>
</page>
</body>

4. Delete all the unnecessary links from the footer. Add the following line into the footer_links block:

<referenceBlock name=”catalog-search-advanced-link” remove=”true”/>

Clear the cache memory and see the menu block was deleted

5. Add a custom link to the About us page. Add the following code to the footer_links block:

To establish the order, we use the block attributes after and before.

Leave a comment

Your email address will not be published. Required fields are marked *