Main Logo Not Linking Back To Home Page / Root

Hi There,

I’m having a weird thing on my website - I’m using the ‘Split’ Theme but I’ve done a little edit to give me separate logos for my desktop and mobile views.

However in this process I have lost the link on my logo which takes me back to the homepage,

I did some reading and looks like;

<a href="/">

Should do the trick but whenever I use it, It re-sizes the header bar like this

As you can see the search icon is out of line - without the above code it looks like this

I’m not sure what is throwing it out - Any ideas?

The rest of my code for that section is;

{% if section.settings.logo != blank %}
{% capture image_size %}{{ section.settings.logo_max_width }}x{% endcapture %} {{ section.settings.logo.alt | default: shop.name }} {% else %} {{ shop.name | escape }}

{% endif %}

1 Like

@Bilbo

Welcome to the Shopify community!
and Thanks for your Good question.

Please share your site URL,
So I will check and provide a solution here.

1 Like

Thank you so much. The site isn’t live yet so here is the preview URL

https://ngy99akya6x6lub5-50213093576.shopifypreview.com

@Bilbo

Thanks for url can you please share header section code so i will update

1 Like

@KetanKumar

Thank you so much see below

{% if template == ‘index’ %}

{% else %} {% endif %}
{% if section.settings.logo != blank %}
{% capture image_size %}{{ section.settings.logo_max_width }}x{% endcapture %} {{ section.settings.logo.alt | default: shop.name }} {% else %} { shop.name | escape }} {% endif %}
{% if section.settings.mobile_logo != blank %} {% capture image_size %}{{ section.settings.mobile_logo_max_width }}x{% endcapture %} {{ section.settings.logo.alt | default: shop.name }} {% else %} {{ shop.name | escape }} {% endif %}
{%- if template == 'index' -%}

{% else %} {% endif %}

{%- if section.settings.show_promotion_block -%}
{%- capture promotion_block -%}

{{ section.settings.promotion_header | escape }}

{{ section.settings.promotion_content }}
{% if section.settings.promotion_button_label != blank %} {{ section.settings.promotion_button_label | escape }} {% endif %}

{% unless section.settings.promotion_image == blank %}

{% assign image = section.settings.promotion_image %} {{ image.alt | escape }}
{% endunless %}
{%- assign color_text_brightness = section.settings.promotion_color_txt | color_brightness -%} {%- if color_text_brightness > 65 -%} {%- assign color_text_contrast = '#000' -%} {%- else -%} {%- assign color_text_contrast = '#fff' -%} {%- endif -%} #menu-promotion > div { color: {{ section.settings.promotion_color_txt }}; } #menu-promotion a { color: {{ section.settings.promotion_color_txt }}; } #menu-promotion .button { color: {{ color_text_contrast }} !important; background: {{ section.settings.promotion_color_txt }} !important; } {%- if section.settings.promotion_image == blank -%} #menu-promotion > div { background: {{ section.settings.promotion_color_bg }}; } {%- else -%} #menu-promotion .site-box-background.with-image:after { background: {{ section.settings.promotion_color_bg }}; } {%- endif -%}
{%- endcapture -%} {%- endif -%}

{%- if section.settings.menu_style == ‘classic’ -%}

{% render 'site-nav', linklist: section.settings.main_linklist, collection_linklist: section.settings.collection_linklist, show_collection_images: section.settings.show_collection_image, promotion_block: promotion_block, type: 'classic' %}
{%- endif -%}

{% if template.name == ‘collection’ %}

{% endif %}

{% render 'theme-symbols', icon: 'search_icon' %} {% render 'theme-symbols', icon: 'cart_icon' %} {{ cart.item_count }}

{% if section.settings.bar_enable %}

{% if section.settings.bar_home_only == false or template == ‘index’ and section.settings.bar_home_only %}

{% if section.settings.bar_link != blank %}

{% endif %}

{{ section.settings.bar_content }}

{% if section.settings.bar_link != blank %}

{% endif %}

.site-header .box__banner { background-color: {{ section.settings.bar_bgcolor }}; color: {{ section.settings.bar_txtcolor }} !important; } .site-header .box__banner a { color: {{ section.settings.bar_txtcolor }} !important; } .site-header .box__banner svg * { fill: {{ section.settings.bar_txtcolor }}; }

{% if section.settings.bar_show_dismiss %}
{% render ‘theme-symbols’, icon: ‘close_icon’ %}
{% endif %}

{% endif %}

{% endif %}

{{ 'sidebar.menu' | t }}

{% render 'site-nav', linklist: section.settings.main_linklist, collection_linklist: section.settings.collection_linklist, show_collection_images: false, type: 'sidebar' %}

{% if promotion_block %}
{{ promotion_block }}
{% endif %}

{% render ‘social-icons’, size: ‘regular’ %}

{{ 'general.copyright' | t }} © {{ 'now' | date: "%Y" }} {{ shop.name | escape }}

{{ powered_by_link }}

{% if template.name == ‘collection’ %}

{{ 'sidebar.collection_filters.title' | t }}

{{ 'sidebar.collection_filters.items_count' | t: count: collection.products.size, collection: collection.title }}

{{ 'collections.filtering.title' | t }}

{% if collection.all_tags.size > 0 %}

{{ ‘collections.filtering.title’ | t }}

{% assign categories = ‘’ %}

{%- for tag in collection.all_tags -%}
{%- if tag contains ‘’ -%}
{%- capture categories -%}{%- unless categories == blank -%}{{ categories }}|{%- endunless -%}{{ tag | split: '
’ | first }}{%- endcapture -%}
{%- endif -%}
{%- endfor -%}
{%- assign cat_array = categories | split: ‘|’ | uniq -%}

{%- for cat_item in cat_array -%}

{% endfor %}

{% endif %}

{{ 'collections.sorting.title' | t }}

{{ ‘sidebar.collection_filters.submit’ | t }}

{{ ‘sidebar.collection_filters.clear’ | t }}

{% endif %}

{{ 'sidebar.search' | t }}

{% render ‘search-form’, type: ‘ajax’ %}

{{ 'sidebar.cart.title' | t }}

{{ 'sidebar.cart.items_count' | t: count: cart.item_count }}

{% unless template contains ‘cart’ %}
{% render ‘cart-form’, type: ‘sidebar’ %}
{% endunless %}

{% schema %}
{
“name”: “Header”,
“class”: “mount-header”,
“settings”: [
{
“type”: “image_picker”,
“id”: “logo”,
“label”: “Logo image”
},
{
“type”: “range”,
“id”: “logo_max_width”,
“min”: 50,
“max”: 450,
“step”: 10,
“unit”: “px”,
“label”: “Custom logo width”,
“default”: 250
},
{
“type”: “image_picker”,
“id”: “mobile_logo”,
“label”: “Mobile image”
},
{
“type”: “range”,
“id”: “mobile_logo_max_width”,
“min”: 50,
“max”: 450,
“step”: 10,
“unit”: “px”,
“label”: “Custom logo width”,
“default”: 60
},
{
“type”: “link_list”,
“id”: “main_linklist”,
“label”: “Menu”,
“default”: “main-menu”
},
{
“type”: “select”,
“id”: “menu_style”,
“label”: “Desktop menu style”,
“options”: [
{
“value”: “classic”,
“label”: “Classic”
},
{
“value”: “minimal”,
“label”: “Minimal”
}
]
},
{
“type”: “header”,
“content”: “Collections menu”,
“info”: “This has a bold design, especially in the classic menu style, where it transforms into a mega menu with the possibility of adding images and a promotion.”
},
{
“type”: “link_list”,
“id”: “collection_linklist”,
“label”: “Menu”
},
{
“type”: “checkbox”,
“id”: “show_collection_image”,
“label”: “Show collection images”,
“default”: true,
“info”: “Only applies if the parent items is a collection.”
},
{
“type”: “header”,
“content”: “Promotion block”
},
{
“type”: “checkbox”,
“id”: “show_promotion_block”,
“label”: “Show promotion block”,
“default”: false,
“info”: “In minimal style it shows at the bottom of the menu drawer. In classic style it shows in the collections menu, if present.”
},
{
“type”: “text”,
“id”: “promotion_header”,
“label”: “Promotion title”
},
{
“type”: “richtext”,
“id”: “promotion_content”,
“label”: “Promotion content”
},
{
“type”: “text”,
“id”: “promotion_button_label”,
“label”: “Promotion button label”
},
{
“type”: “url”,
“id”: “promotion_button_link”,
“label”: “Promotion button link”
},
{
“type”: “color”,
“id”: “promotion_color_txt”,
“label”: “Promotion text color”,
“default”: “#000000
},
{
“type”: “color”,
“id”: “promotion_color_bg”,
“label”: “Promotion background color”,
“default”: “#f3f3f3
},
{
“type”: “image_picker”,
“id”: “promotion_image”,
“label”: “Promotion image”
},
{
“type”: “header”,
“content”: “Announcement bar”
},
{
“type”: “checkbox”,
“id”: “bar_enable”,
“label”: “Show announcement”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “bar_home_only”,
“label”: “Home page only”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “bar_show_dismiss”,
“label”: “Show dismiss button”,
“default”: true
},
{
“type”: “text”,
“id”: “bar_content”,
“label”: “Content”,
“default”: “Use this bar for a short, important announcement.”,
“info”: “Max 50 characters”
},
{
“type”: “url”,
“id”: “bar_link”,
“label”: “Link”,
“info”: “Optional”
},
{
“type”: “color”,
“id”: “bar_bgcolor”,
“label”: “Background color”,
“default”: “#D23232
},
{
“type”: “color”,
“id”: “bar_txtcolor”,
“label”: “Text color”,
“default”: “#ffffff
}
]
}
{% endschema %}

@Bilbo

Thanks can you please update this code


{{ 'sidebar.menu' | t }}

{% if promotion_block %}
{{ promotion_block }}
{% endif %}

{% render 'social-icons', size: 'regular' %}

{{ 'general.copyright' | t }} © {{ 'now' | date: "%Y" }} {{ shop.name | escape }}

{{ powered_by_link }}

{% if template.name == 'collection' %}

{{ 'sidebar.collection_filters.title' | t }}

{{ 'sidebar.collection_filters.items_count' | t: count: collection.products.size, collection: collection.title }}

{% if collection.all_tags.size > 0 %}

{% assign categories = '' %}

{%- for tag in collection.all_tags -%}
{%- if tag contains '_' -%}
{%- capture categories -%}{%- unless categories == blank -%}{{ categories }}|{%- endunless -%}{{ tag | split: '_' | first }}{%- endcapture -%}
{%- endif -%}
{%- endfor -%}
{%- assign cat_array = categories | split: '|' | uniq -%}

{%- for cat_item in cat_array -%}

{% endfor %}

{% endif %}

{% endif %}

{{ 'sidebar.search' | t }}

{% render 'search-form', type: 'ajax' %}

{{ 'sidebar.cart.title' | t }}

{{ 'sidebar.cart.items_count' | t: count: cart.item_count }}

{% unless template contains 'cart' %}
{% render 'cart-form', type: 'sidebar' %}
{% endunless %}

{% schema %}
{
"name": "Header",
"class": "mount-header",
"settings": [
{
"type": "image_picker",
"id": "logo",
"label": "Logo image"
},
{
"type": "range",
"id": "logo_max_width",
"min": 50,
"max": 450,
"step": 10,
"unit": "px",
"label": "Custom logo width",
"default": 250
},
{
"type": "image_picker",
"id": "mobile_logo",
"label": "Mobile image"
},
{
"type": "range",
"id": "mobile_logo_max_width",
"min": 50,
"max": 450,
"step": 10,
"unit": "px",
"label": "Custom logo width",
"default": 60
},
{
"type": "link_list",
"id": "main_linklist",
"label": "Menu",
"default": "main-menu"
},
{
"type": "select",
"id": "menu_style",
"label": "Desktop menu style",
"options": [
{
"value": "classic",
"label": "Classic"
},
{
"value": "minimal",
"label": "Minimal"
}
]
},
{
"type": "header",
"content": "Collections menu",
"info": "This has a bold design, especially in the classic menu style, where it transforms into a mega menu with the possibility of adding images and a promotion."
},
{
"type": "link_list",
"id": "collection_linklist",
"label": "Menu"
},
{
"type": "checkbox",
"id": "show_collection_image",
"label": "Show collection images",
"default": true,
"info": "Only applies if the parent items is a collection."
},
{
"type": "header",
"content": "Promotion block"
},
{
"type": "checkbox",
"id": "show_promotion_block",
"label": "Show promotion block",
"default": false,
"info": "In minimal style it shows at the bottom of the menu drawer. In classic style it shows in the collections menu, if present."
},
{
"type": "text",
"id": "promotion_header",
"label": "Promotion title"
},
{
"type": "richtext",
"id": "promotion_content",
"label": "Promotion content"
},
{
"type": "text",
"id": "promotion_button_label",
"label": "Promotion button label"
},
{
"type": "url",
"id": "promotion_button_link",
"label": "Promotion button link"
},
{
"type": "color",
"id": "promotion_color_txt",
"label": "Promotion text color",
"default": "#000000"
},
{
"type": "color",
"id": "promotion_color_bg",
"label": "Promotion background color",
"default": "#f3f3f3"
},
{
"type": "image_picker",
"id": "promotion_image",
"label": "Promotion image"
},
{
"type": "header",
"content": "Announcement bar"
},
{
"type": "checkbox",
"id": "bar_enable",
"label": "Show announcement",
"default": false
},
{
"type": "checkbox",
"id": "bar_home_only",
"label": "Home page only",
"default": true
},
{
"type": "checkbox",
"id": "bar_show_dismiss",
"label": "Show dismiss button",
"default": true
},
{
"type": "text",
"id": "bar_content",
"label": "Content",
"default": "Use this bar for a short, important announcement.",
"info": "Max 50 characters"
},
{
"type": "url",
"id": "bar_link",
"label": "Link",
"info": "Optional"
},
{
"type": "color",
"id": "bar_bgcolor",
"label": "Background color",
"default": "#D23232"
},
{
"type": "color",
"id": "bar_txtcolor",
"label": "Text color",
"default": "#ffffff"
}
]
}
{% endschema %}
1 Like

Updated,

If you Check the URL you can see its messed up the spacing of the menu bar.

I also added this into theme.ccs

/================ Display and hide logo images on header ================/

/* Large devices (over 700 px) */
@media only screen and (min-width: 701px) {
#mobile{
display:none;
}
}

/* Small devices (under 700 px) */
@media only screen and (max-width: 700px) {
#desktop{
display:none;
}
}

@Bilbo

yes, current

if you have any issue let me know

1 Like

@KetanKumar

Sorry its having the sam issue unfortunately

https://ngy99akya6x6lub5-50213093576.shopifypreview.com

1 Like

@Bilbo

YEs, please can you please share issue image so i will guide you.

@KetanKumar

Any idea why I’m having the same issue?

See image,

You can see the logo is not central but also the search icon is out of line.

1 Like

@Bilbo

if possible to add me staff account so i will quickly fix this issue it’s something is missing on your header file

1 Like

@Bilbo

Thanks for add me staff

i have fix this issue please check

Here is the code that fixed the issue for others :slightly_smiling_face:

Thank you so much for your help Ketan!

{% if template == ‘index’ %}

{% else %} {% endif %}
{% if section.settings.logo != blank %}
{% capture image_size %}{{ section.settings.logo_max_width }}x{% endcapture %} {{ section.settings.logo.alt | default: shop.name }} {% else %} { shop.name | escape }} {% endif %}
{% if section.settings.mobile_logo != blank %} {% capture image_size %}{{ section.settings.mobile_logo_max_width }}x{% endcapture %} {{ section.settings.logo.alt | default: shop.name }} {% else %} {{ shop.name | escape }} {% endif %}
{%- if template == 'index' -%}

{% else %} {% endif %}

{%- if section.settings.show_promotion_block -%}
{%- capture promotion_block -%}

{{ section.settings.promotion_header | escape }}

{{ section.settings.promotion_content }}
{% if section.settings.promotion_button_label != blank %} {{ section.settings.promotion_button_label | escape }} {% endif %}

{% unless section.settings.promotion_image == blank %}

{% assign image = section.settings.promotion_image %} {{ image.alt | escape }}
{% endunless %}
{%- assign color_text_brightness = section.settings.promotion_color_txt | color_brightness -%} {%- if color_text_brightness > 65 -%} {%- assign color_text_contrast = '#000' -%} {%- else -%} {%- assign color_text_contrast = '#fff' -%} {%- endif -%} #menu-promotion > div { color: {{ section.settings.promotion_color_txt }}; } #menu-promotion a { color: {{ section.settings.promotion_color_txt }}; } #menu-promotion .button { color: {{ color_text_contrast }} !important; background: {{ section.settings.promotion_color_txt }} !important; } {%- if section.settings.promotion_image == blank -%} #menu-promotion > div { background: {{ section.settings.promotion_color_bg }}; } {%- else -%} #menu-promotion .site-box-background.with-image:after { background: {{ section.settings.promotion_color_bg }}; } {%- endif -%}
{%- endcapture -%} {%- endif -%}

{%- if section.settings.menu_style == ‘classic’ -%}

{% render 'site-nav', linklist: section.settings.main_linklist, collection_linklist: section.settings.collection_linklist, show_collection_images: section.settings.show_collection_image, promotion_block: promotion_block, type: 'classic' %}
{%- endif -%}

{% if template.name == ‘collection’ %}

{% endif %}

{% render 'theme-symbols', icon: 'search_icon' %} {% render 'theme-symbols', icon: 'cart_icon' %} {{ cart.item_count }}

{% if section.settings.bar_enable %}

{% if section.settings.bar_home_only == false or template == ‘index’ and section.settings.bar_home_only %}

{% if section.settings.bar_link != blank %}

{% endif %}

{{ section.settings.bar_content }}

{% if section.settings.bar_link != blank %}

{% endif %}

.site-header .box__banner { background-color: {{ section.settings.bar_bgcolor }}; color: {{ section.settings.bar_txtcolor }} !important; } .site-header .box__banner a { color: {{ section.settings.bar_txtcolor }} !important; } .site-header .box__banner svg * { fill: {{ section.settings.bar_txtcolor }}; }

{% if section.settings.bar_show_dismiss %}
{% render ‘theme-symbols’, icon: ‘close_icon’ %}
{% endif %}

{% endif %}

{% endif %}

{{ 'sidebar.menu' | t }}

{% render 'site-nav', linklist: section.settings.main_linklist, collection_linklist: section.settings.collection_linklist, show_collection_images: false, type: 'sidebar' %}

{% if promotion_block %}
{{ promotion_block }}
{% endif %}

{% render ‘social-icons’, size: ‘regular’ %}

{{ 'general.copyright' | t }} © {{ 'now' | date: "%Y" }} {{ shop.name | escape }}

{{ powered_by_link }}

{% if template.name == ‘collection’ %}

{{ 'sidebar.collection_filters.title' | t }}

{{ 'sidebar.collection_filters.items_count' | t: count: collection.products.size, collection: collection.title }}

{{ 'collections.filtering.title' | t }}

{% if collection.all_tags.size > 0 %}

{{ ‘collections.filtering.title’ | t }}

{% assign categories = ‘’ %}

{%- for tag in collection.all_tags -%}
{%- if tag contains ‘’ -%}
{%- capture categories -%}{%- unless categories == blank -%}{{ categories }}|{%- endunless -%}{{ tag | split: '
’ | first }}{%- endcapture -%}
{%- endif -%}
{%- endfor -%}
{%- assign cat_array = categories | split: ‘|’ | uniq -%}

{%- for cat_item in cat_array -%}

{% endfor %}

{% endif %}

{{ 'collections.sorting.title' | t }}

{{ ‘sidebar.collection_filters.submit’ | t }}

{{ ‘sidebar.collection_filters.clear’ | t }}

{% endif %}

{{ 'sidebar.search' | t }}

{% render ‘search-form’, type: ‘ajax’ %}

{{ 'sidebar.cart.title' | t }}

{{ 'sidebar.cart.items_count' | t: count: cart.item_count }}

{% unless template contains ‘cart’ %}
{% render ‘cart-form’, type: ‘sidebar’ %}
{% endunless %}

{% schema %}
{
“name”: “Header”,
“class”: “mount-header”,
“settings”: [
{
“type”: “image_picker”,
“id”: “logo”,
“label”: “Logo image”
},
{
“type”: “range”,
“id”: “logo_max_width”,
“min”: 50,
“max”: 450,
“step”: 10,
“unit”: “px”,
“label”: “Custom logo width”,
“default”: 250
},
{
“type”: “image_picker”,
“id”: “mobile_logo”,
“label”: “Mobile image”
},
{
“type”: “range”,
“id”: “mobile_logo_max_width”,
“min”: 50,
“max”: 450,
“step”: 10,
“unit”: “px”,
“label”: “Custom logo width”,
“default”: 60
},
{
“type”: “link_list”,
“id”: “main_linklist”,
“label”: “Menu”,
“default”: “main-menu”
},
{
“type”: “select”,
“id”: “menu_style”,
“label”: “Desktop menu style”,
“options”: [
{
“value”: “classic”,
“label”: “Classic”
},
{
“value”: “minimal”,
“label”: “Minimal”
}
]
},
{
“type”: “header”,
“content”: “Collections menu”,
“info”: “This has a bold design, especially in the classic menu style, where it transforms into a mega menu with the possibility of adding images and a promotion.”
},
{
“type”: “link_list”,
“id”: “collection_linklist”,
“label”: “Menu”
},
{
“type”: “checkbox”,
“id”: “show_collection_image”,
“label”: “Show collection images”,
“default”: true,
“info”: “Only applies if the parent items is a collection.”
},
{
“type”: “header”,
“content”: “Promotion block”
},
{
“type”: “checkbox”,
“id”: “show_promotion_block”,
“label”: “Show promotion block”,
“default”: false,
“info”: “In minimal style it shows at the bottom of the menu drawer. In classic style it shows in the collections menu, if present.”
},
{
“type”: “text”,
“id”: “promotion_header”,
“label”: “Promotion title”
},
{
“type”: “richtext”,
“id”: “promotion_content”,
“label”: “Promotion content”
},
{
“type”: “text”,
“id”: “promotion_button_label”,
“label”: “Promotion button label”
},
{
“type”: “url”,
“id”: “promotion_button_link”,
“label”: “Promotion button link”
},
{
“type”: “color”,
“id”: “promotion_color_txt”,
“label”: “Promotion text color”,
“default”: “#000000
},
{
“type”: “color”,
“id”: “promotion_color_bg”,
“label”: “Promotion background color”,
“default”: “#f3f3f3
},
{
“type”: “image_picker”,
“id”: “promotion_image”,
“label”: “Promotion image”
},
{
“type”: “header”,
“content”: “Announcement bar”
},
{
“type”: “checkbox”,
“id”: “bar_enable”,
“label”: “Show announcement”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “bar_home_only”,
“label”: “Home page only”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “bar_show_dismiss”,
“label”: “Show dismiss button”,
“default”: true
},
{
“type”: “text”,
“id”: “bar_content”,
“label”: “Content”,
“default”: “Use this bar for a short, important announcement.”,
“info”: “Max 50 characters”
},
{
“type”: “url”,
“id”: “bar_link”,
“label”: “Link”,
“info”: “Optional”
},
{
“type”: “color”,
“id”: “bar_bgcolor”,
“label”: “Background color”,
“default”: “#D23232
},
{
“type”: “color”,
“id”: “bar_txtcolor”,
“label”: “Text color”,
“default”: “#ffffff
}
]
}
{% endschema %}

1 Like

@Bilbo

Greate for share us

1 Like