How to add and redirect a second logo in the header?

Hi everyone!

so basically i want to add another logo to the header and redirect visitors to a second website. lets say this is website A and i want to Direct visitors to website B.

currently on website A there is a logo of website A which it directs you to landing page of website A if you click on it. now i want to add a second logo and when visitors click on it, it directs them to website B. i checked the header.liquid and i saw that there was a limit to number of logos so naturally i changed 1 to 2. after that i added the code for the link and i typed the website B link into it. now there are 2 logos but both direct visitors to website A landing page.

not sure why but either the link code is being ignored or it is being overwritten by another code some where.

here is the section of header.liquid that i have changed.

“blocks”: [
{
“type”: “logo”,
“name”: “Logo”,
“limit”: 2,
“settings”: [
{
“type”: “image_picker”,
“id”: “logo”,
“label”: “Logo”
},
{
“type”: “image_picker”,
“id”: “logo-inverted”,
“label”: “White logo”,
“info”: “Used when on top of an image”
},
{
“type”: “range”,
“id”: “desktop_logo_width”,
“label”: “Desktop logo width”,
“default”: 200,
“min”: 100,
“max”: 400,
“step”: 10,
“unit”: “px”
},
{
“type”: “range”,
“id”: “mobile_logo_width”,
“label”: “Mobile logo width”,
“default”: 140,
“min”: 60,
“max”: 200,
“step”: 10,
“unit”: “px”,
“info”: “Set as a max-width, may appear smaller”
},
{
“type”: “url”,
“id”: “link”,
“label”: “Link”
}
]

can someone help to fix this issue? thanks in advance!

Can you post the full code of the header file. I will check and guide you to change it.

Sure, here it is:

{%- assign main_menu = linklists[section.settings.main_menu_link_list] -%}
{%- assign toolbar_menu = linklists[section.settings.toolbar_menu] -%}

{%- assign logo_alignment = ‘left’ -%}
{% if section.settings.main_menu_alignment == ‘center-left’ or section.settings.main_menu_alignment == ‘center-split’ or section.settings.main_menu_alignment == ‘center’ or section.settings.main_menu_alignment == ‘center-drawer’ %}
{%- assign logo_alignment = ‘center’ -%}
{% endif %}

{%- assign dropdown_alignment = ‘left’ -%}
{% if section.settings.main_menu_alignment == ‘left-center’ or section.settings.main_menu_alignment == ‘center-split’ or section.settings.main_menu_alignment == ‘center’ %}
{%- assign dropdown_alignment = ‘center’ -%}
{% endif %}

{% if section.settings.drawer_menu_style == ‘Style 1’ %}
{% render ‘drawer-menu_1’,
section: section,
main_menu: main_menu,
toolbar_menu: toolbar_menu,
logo_alignment: logo_alignment
%}
{% else %}
{% render ‘drawer-menu_2’,
section: section,
main_menu: main_menu,
toolbar_menu: toolbar_menu,
logo_alignment: logo_alignment
%}
{% endif %}
{% render ‘cart-drawer’ %}

{%- assign template_name = template | replace: ‘.’, ’ ’ | truncatewords: 2, ‘’ | handle -%}

{%- assign sticky_header = false -%}
{% if section.settings.header_style == ‘sticky’ %}
{%- assign sticky_header = true -%}
{% endif %}
{%- assign overlay_header = false -%}
{%- assign has_logo = false -%}
{% if template_name == ‘index’ and section.settings.sticky_index %}
{%- assign overlay_header = true -%}
{% endif %}
{% if template_name == ‘collection’ and collection.image and section.settings.sticky_collection %}
{%- assign overlay_header = true -%}
{% endif %}

.site-nav__link, .site-nav__dropdown-link:not(.site-nav__dropdown-link--top-level) { font-size: {{ settings.type_navigation_size }}px; } {% if settings.type_navigation_capitalize %} .site-nav__link, .mobile-nav__link--top-level { text-transform: uppercase; letter-spacing: 0.2em; } .mobile-nav__link--top-level { font-size: 1.1em; } {% endif %} {% if mainmenu.length > 6 %} .site-nav__link { padding-left: 10px; padding-right: 10px; } {% endif %} {% unless section.settings.mega_menu_images %} .megamenu__colection-image { display: none; } {% endunless %} {%- if settings.color_header == settings.color_body_bg -%} .site-header { box-shadow: 0 0 1px rgba(0,0,0,0.2); } .toolbar + .header-sticky-wrapper .site-header { border-top: 0; } {%- endif -%} {%- if settings.color_announcement == settings.color_body_bg -%} .announcement-bar { border-bottom: 1px solid; } {%- endif -%}
{% if overlay_header or section.settings.announcement_above_header %} {% render 'announcement-bar', section: section %} {% endif %}

{% unless overlay_header %}
{% if section.settings.toolbar_social or section.settings.toolbar_menu != blank %}
{% render ‘toolbar’,
section: section,
toolbar_menu: toolbar_menu,
overlay_header: overlay_header
%}
{% endif %}
{% endunless %}

{% if overlay_header %}
{% if section.settings.toolbar_social or section.settings.toolbar_menu != blank %}
{% render ‘toolbar’,
section: section,
overlay_header: overlay_header
%}
{% endif %}
{% endif %}

{% if logo_alignment == 'left' or logo_alignment == 'center' %} {% if section.settings.main_menu_alignment != 'left-drawer' %}

{% if section.settings.main_menu_alignment == ‘left-center’ or section.settings.main_menu_alignment == ‘left’ or section.settings.main_menu_alignment == ‘center-left’ %}


{{ ‘general.drawers.navigation’ | t }}

{% if settings.search_enable and section.settings.main_menu_alignment != ‘left’ %}




{% endif %}
{% endif %}

{% endif %} {% endif %}

{% if logo_alignment == ‘left’ %}

{% render 'header-logo-block', section: section %}
{% endif %}

{% if logo_alignment == ‘left’ and section.settings.main_menu_alignment != ‘left-drawer’ %}

{% if section.settings.header_megamenu %} {% render 'header-desktop-nav', main_menu: main_menu %} {% else %} {% render 'header-desktop-nav_simple', main_menu_links: main_menu.links %} {% endif %}
{% endif %}

{% if logo_alignment == ‘center’ %}

{% if section.settings.main_menu_alignment != 'center-left' %}
{{ 'general.drawers.navigation' | t }}
{% endif %}

{% if section.settings.main_menu_alignment == ‘center’ or section.settings.main_menu_alignment == ‘center-split’ %}
{% if settings.search_enable %}

{% endif %} {% endif %}

{% if section.settings.main_menu_alignment == ‘center-left’ %}
{% if section.settings.header_megamenu %}
{% render ‘header-desktop-nav’, main_menu: main_menu %}
{% else %}
{% render ‘header-desktop-nav_simple’, main_menu_links: main_menu.links %}
{% endif %}
{% endif %}

{% if section.settings.main_menu_alignment == ‘center-split’ %}
{% render ‘header-split-nav’, main_menu: main_menu, section: section %}
{% endif %}

{% if section.settings.main_menu_alignment != ‘center-split’ %}

{% render 'header-logo-block', section: section %}
{% endif %} {% endif %}
{% render 'header-icons', section: section %}

{% if section.settings.main_menu_alignment == ‘center’ %}

{% if section.settings.header_megamenu %} {% render 'header-desktop-nav', main_menu: main_menu %} {% else %} {% render 'header-desktop-nav_simple', main_menu_links: main_menu.links %} {% endif %}
{% endif %}
{{ 'general.search.submit' | t }} {{ 'general.accessibility.close_modal' | t | json }}
{%- if settings.predictive_search_enabled -%}
{{ 'general.search.view_more' | t }}
{%- endif -%}

{% unless overlay_header or section.settings.announcement_above_header %}
{% render ‘announcement-bar’, section: section %}
{% endunless %}

{% schema %}
{
“name”: “Header”,
“settings”: [
{
“type”: “link_list”,
“id”: “main_menu_link_list”,
“label”: “Navigation”,
“default”: “main-menu”
},
{
“type”: “select”,
“id”: “drawer_menu_style”,
“label”: “Drawer Menu Style”,
“default”: “Style 1”,
“options”: [
{
“value”: “Style 1”,
“label”: “Style 1”
},
{
“value”: “Style 2”,
“label”: “Style 2”
}
]
},
{
“type”: “checkbox”,
“id”: “header_megamenu”,
“label”: “Use mega menu”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “mega_menu_images”,
“label”: “Show mega menu images”,
“default”: true,
“info”: “How to create a mega menu
},
{
“type”: “select”,
“id”: “main_menu_alignment”,
“label”: “Header layout”,
“default”: “left”,
“options”: [
{
“value”: “left”,
“label”: “Logo left, menu left”
},
{
“value”: “left-center”,
“label”: “Logo left, menu center”
},
{
“value”: “left-drawer”,
“label”: “Logo left, menu drawer”
},
{
“value”: “center-left”,
“label”: “Logo center, menu left”
},
{
“value”: “center-split”,
“label”: “Logo center, menu split”
},
{
“value”: “center”,
“label”: “Logo center, menu below”
},
{
“value”: “center-drawer”,
“label”: “Logo center, menu drawer”
}
]
},
{
“type”: “select”,
“id”: “header_style”,
“label”: “Header style”,
“default”: “normal”,
“options”: [
{
“value”: “normal”,
“label”: “Normal”
},
{
“value”: “sticky”,
“label”: “Sticky”
}
]
},
{
“type”: “checkbox”,
“id”: “sticky_index”,
“label”: “Overlay header over home page”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “sticky_collection”,
“label”: “Overlay header over collection”,
“info”: “(if collection image is enabled)”,
“default”: false
},
{
“type”: “header”,
“content”: “Announcement bar”
},
{
“type”: “checkbox”,
“id”: “announcement_above_header”,
“label”: “Always show above header”
},
{
“type”: “header”,
“content”: “Toolbar”
},
{
“type”: “link_list”,
“id”: “toolbar_menu”,
“label”: “Navigation”,
“info”: “This menu won’t show dropdown items”
},
{
“type”: “checkbox”,
“id”: “toolbar_social”,
“label”: “Show social icons”
},
{
“type”: “header”,
“content”: “Currency selector”,
“info”: “To disable / enable currency switcher use Auto Currency Switcher app”
},
{
“type”: “checkbox”,
“id”: “show_currency_flags”,
“label”: “Show currency flags”,
“default”: true
}
],
“blocks”: [
{
“type”: “logo”,
“name”: “Logo”,
“limit”: 2,
“settings”: [
{
“type”: “image_picker”,
“id”: “logo”,
“label”: “Logo”
},
{
“type”: “image_picker”,
“id”: “logo-inverted”,
“label”: “White logo”,
“info”: “Used when on top of an image”
},
{
“type”: “range”,
“id”: “desktop_logo_width”,
“label”: “Desktop logo width”,
“default”: 200,
“min”: 100,
“max”: 400,
“step”: 10,
“unit”: “px”
},
{
“type”: “range”,
“id”: “mobile_logo_width”,
“label”: “Mobile logo width”,
“default”: 140,
“min”: 60,
“max”: 200,
“step”: 10,
“unit”: “px”,
“info”: “Set as a max-width, may appear smaller”
},
{
“type”: “url”,
“id”: “link”,
“label”: “Link”
}
]
},
{
“type”: “announcement”,
“name”: “Announcement”,
“limit”: 3,
“settings”: [
{
“type”: “text”,
“id”: “text”,
“label”: “Heading”,
“default”: “Hassle-free returns”
},
{
“type”: “text”,
“id”: “link_text”,
“label”: “Text”,
“default”: “30-day postage paid returns”
},
{
“type”: “url”,
“id”: “link”,
“label”: “Link”
}
]
},
{
“type”: “menu_image”,
“name”: “Megamenu Image”,
“settings”: [
{
“type”: “text”,
“id”: “title”,
“label”: “Menu title”
},
{
“type”: “image_picker”,
“id”: “image”,
“label”: “Image”
}
]
}
],
“default”: {
“settings”: {}
}
}
{% endschema %}

@LitExtension any updates?

Please send me the “snippets/header-logo-block.liquid” file, I will check it.
I will guide you how to add a link to it.

@LitExtension Here you go

{% for block in section.blocks %}
{% if block.type == ‘logo’ %}

{%- assign has_logo = true -%}
{%- assign header_logo_size = block.settings.desktop_logo_width | append: ‘x’ -%}
{%- assign header_logo_size_mobile = block.settings.mobile_logo_width | append: ‘x’ -%}

{% style %}
.header-item–logo,
.header-layout–left-center .header-item–logo,
.header-layout–left-center .header-item–icons {
-webkit-box-flex: 0 1 {{ block.settings.mobile_logo_width }}px;
-ms-flex: 0 1 {{ block.settings.mobile_logo_width }}px;
flex: 0 1 {{ block.settings.mobile_logo_width }}px;
}

@media only screen and (min-width: 769px) {
.header-item–logo,
.header-layout–left-center .header-item–logo,
.header-layout–left-center .header-item–icons {
{%comment%}
-webkit-box-flex: 0 0 {{ block.settings.desktop_logo_width }}px;
-ms-flex: 0 0 {{ block.settings.desktop_logo_width }}px;
flex: 0 0 {{ block.settings.desktop_logo_width }}px;
{%endcomment%}
-webkit-box-flex: 0 0 230px;
-ms-flex: 0 0 230px;
flex: 0 0 230px;
}
}

.site-header__logo a {
width: {{ block.settings.mobile_logo_width }}px;
}
.is-light .site-header__logo .logo–inverted {
width: {{ block.settings.mobile_logo_width }}px;
}
@media only screen and (min-width: 769px) {
.site-header__logo a {
width: {{ block.settings.desktop_logo_width }}px;
}

.is-light .site-header__logo .logo–inverted {
width: {{ block.settings.desktop_logo_width }}px;
}
}

@media only screen and (max-width: 768px) {
.header-layout–left-center > .header-item–icons,
.header-layout–left-center > .site-nav{
width: calc(50vw - {{ block.settings.mobile_logo_width | divided_by: 2 }}px - 17px);
flex: 0 1 auto !important;
}
}
{% endstyle %}

{% if template == ‘index’ %}

{{ shop.name }} {% else %}
{% endif %}

{% if block.settings.logo %}
{% comment %}
.logo–has-inverted is only applied to the default logo if the inverted logo exists. That way it’ll only be hidden on the slider when it has a backup.
{% endcomment %}

{{ block.settings.logo.alt | default: shop.name }}
{{ block.settings.logo.alt | default: shop.name }}

{% if block.settings.logo-inverted %}

{{ block.settings.logo-inverted.alt | default: shop.name }}
{{ block.settings.logo.alt | default: shop.name }}

{% endif %}
{% else %}
{{ shop.name }}
{% endif %}
{% if template == ‘index’ %}

{% else %} {% endif %}

{% endif %}
{% endfor %}

{% unless has_logo %}
{% style %}
/* prevent text-only logo from breaking mobile nav */
.header-item–logo {
max-width: 60%;
}
{% endstyle %}
{% if template == ‘index’ %}

{% else %}
{% endif %} {{ shop.name }} {% if template == 'index' %}

{% else %} {% endif %} {% endunless %}