Open the “vendor/magento/module-catalog/view/frontend/layout/default.xml” file.
Find the following line:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
and input the following code before the body end tag:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This will remove ‘compare product’ from the category product listing, however you can use this method for any other layout as well.
Blog link
Open the app\code\TemplateMonster\Blog\view\frontend\layout\default.xml file and find
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Open the vendor\magento\module-customer\view\frontend\layout\default.xml file and find the text code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Open the vendor\magento\module-customer\view\frontend\templates\account\link\authorization.phtml file and find the following code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You can remove it or edit, as well as the previous links.
Add the Custom Link
We will also show you how to add a contact link (CMS page based) to the Magento 2 top links header.
Firstly, you need to create a CMS page, for example, a “Contact Us” page with the “contacts” identifier.
Secondly, link access to the contacts page http://domain.com/contacts
Thirdly, to add Magento 2 top links, you need to add the following code into a default.xml file of your theme.
Add the code after the body tag of the *.xml file. For example, insert it into the following file: app/design/frontend/TemplateMonster/themeXXX/Magento_Theme/layout/default.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The code will redirect to “Magento\Framework\View\Element\Html\Link” class, the transfers label = Contact Us and path = contacts (http://domain.com/contacts)
We want to show you how to manage this using Static Block as well. You can add a new static block to your theme default.xml file.
Then add the code after the body tag of the *.xml file. For example, insert it into the following file: app/design/frontend/TemplateMonster/themeXXX/Magento_Theme/layout/default.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters