How to Change Header Logo Image URL Magento 2.1. So I click the header logo to go to another website.
-
You are asking about favicon ? Can you elaborate your question?– Venu JoginpallyCommented Dec 12, 2016 at 12:29
-
Why you want to change header logo URL? elaborate more.– Chirag PrajapatiCommented Dec 12, 2016 at 12:42
-
So I click the header logo to go to another website.– bob barCommented Dec 12, 2016 at 13:35
3 Answers
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
You can add your URL here.
<?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()) ?>"
Content -> Design -> Configuration-> <your theme> -> Header settings -> logo
-
1this will change logo image. not URL of the image. thank you– bob barCommented Dec 12, 2016 at 13:30