0

I am trying to add custom header link, but it is not showing.

0

To add custom Header Link :

Create a default.xml file in the below path.

app/code/design/frontend/Vendor/theme/Magento_Theme/layout/default.xml

Add the Below Code.

<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">customlinkpath</argument>
            </arguments>
        </block>
    </referenceBlock>
</body>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.