In this post we are discussing on how we can add custom menu to the magento 2 top menu

Add these code to YourTheme/Magento_Theme/layout/default.xml

 <referenceContainer name="catalog.topnav">
               <block before="-" class="Magento\Framework\View\Element\Html\Link\Current" name="your.link">
                    <arguments>
                        <argument name="label" xsi:type="string">Link-name</argument>
                        <argument name="path" xsi:type="string">Link-url</argument>
                    </arguments>
              </block> 
 </referenceContainer>

This is how we can add custom links to magento 2 top menu.

2 Comments on “Magento 2 – Add custom links to top menu

  1. Jason
    February 23, 2018

    This doesn’t work on 2.2.1

    • navaneeth
      April 22, 2018

      Yes

Leave a Reply

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