I am searching header.links block to remove one link and add some links but I am not getting where to make changes. Suggest me some solution
-
In this same custom links, how can I add the custom class? – Abrar Pathan Apr 29 '19 at 13:20
-
This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. - From Review – fmsthird Apr 29 '19 at 13:43
-
If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review – Jai Apr 29 '19 at 14:40
I Hope this is useful for you,
if you want to remove top.links
Add default.xml file in this path
app/design/frontend/vendor/theme/Magento_Theme/layout/default.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="register-link" remove="true" /> <!--for Create Account Link-->
<referenceBlock name="authorization-link" remove="true" /> <!--for Sign In Link -->
<referenceBlock name="wish-list-link" remove="true" /> <!--for WishList Link-->
<referenceBlock name="my-account-link" remove="true" /> <!--for My Account Link-->
</body>
</page>
if you want to add Custom top links:
go to app/design/frontend/vendor/theme/Magento_Theme/layout/default.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="header.links">
<block class="Magento\Framework\View\Element\Html\Link" name="custom-link">
<arguments>
<argument name="label" xsi:type="string" translate="true">custom link</argument>
<argument name="path" xsi:type="string" translate="true">customlink</argument>
</arguments>
</block>
</referenceBlock>
</body>
</page>
You can add and remove top links by add this line in your in Magento_Theme/layout/default.xml
<referenceBlock name="header.links">
<block class="Magento\Framework\View\Element\Html\Link" name="new.link" after="register-link">
<arguments>
<argument name="label" xsi:type="string" translate="false">New Link</argument>
<argument name="path" xsi:type="string" translate="false">newlink</argument>
</arguments>
</block>
<!-- here you can remove whatever link you feel unwanted -->
<referenceBlock name="register-link" remove="true" /> <!--for Create Account Link-->
<referenceBlock name="authorization-link" remove="true" /> <!--for Sign In Link -->
<referenceBlock name="wish-list-link" remove="true" /> <!--for WishList Link-->
<referenceBlock name="my-account-link" remove="true" /> <!--for My Account Link-->
</referenceBlock>
-
1
-
i have created custom links in header, how to move into after logo @Bilal Usean – zus Dec 11 '20 at 10:08