3

How to Change Header Logo Image URL Magento 2.1. So I click the header logo to go to another website.

3
  • You are asking about favicon ? Can you elaborate your question? Commented Dec 12, 2016 at 12:29
  • Why you want to change header logo URL? elaborate more. Commented Dec 12, 2016 at 12:42
  • So I click the header logo to go to another website.
    – bob bar
    Commented Dec 12, 2016 at 13:35

3 Answers 3

3

You have to override vendor/magento/module-theme/view/frontend/templates/html/header/logo.phtml in your theme.

Your theme path is like : app/design/frontend/{vendor}/{theme}/Magento_Theme/templates/html/header/logo.phtml

enter image description here

You can add your URL here.

0
3
<?xml version="1.0" encoding="UTF-8"?>
<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-wrapper">
            <block class="Magento\Theme\Block\Html\Header\Logo" name="logo">
                <arguments>
                    <argument name="logo_src" xsi:type="string">images/logo.png</argument>
                </arguments>
            </block>
        </referenceBlock>
    </body>
</page>

If needs use "theme" url:

Copy

app/code/Magento/Theme/view/frontend/templates/html/header/logo.phtml

to

app/design/frontend/{vendor}/{theme}/Magento_Theme/templates/html/header/logo.phtml

and change

src="<?= $block->getLogoSrc() ?>"

to

src="<?= $block->getViewFileUrl($block->getLogoSrc()) ?>"

1
Content -> Design -> Configuration-> <your theme> -> Header settings -> logo
1
  • 1
    this will change logo image. not URL of the image. thank you
    – bob bar
    Commented Dec 12, 2016 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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