Hi,
I have been trying and trying to get the positioning of our phone number and additional search bar to line up with the logo in our header but it keeps going below or above but not in line. I know it will be to do with styling ect but I just can not find where it is. Please can anyone help. it can be seen here - www.duxburyshomeandgarden.co.uk.
Thank you for any help.
Hello @Duxburys
Please share sections/header.liquid file code .
Thanks!
Header Code (there is a lot!)
{%- assign logo_width = 695 -%}
{%- assign logo_max_width = section.settings.logo_max_width | times: 1 -%}
{% if logo_max_width < logo_width %}
{%- assign logo_width = logo_max_width -%}
{% endif %}
.logo__image-wrapper {
max-width: {{ logo_width }}px;
}
/*================= If logo is above navigation ================== */
{% if section.settings.nav_below_logo %}
.site-nav {
{% if section.settings.show_header_lines %}
border-top: 1px solid {{ settings.color_borders }};
border-bottom: 1px solid {{ settings.color_borders }};
{% endif %}
margin-top: 8px;
}
{% unless section.settings.left_aligned_logo %}
.logo__image-wrapper {
margin: 0 auto;
}
{% endunless %}
{% endif %}
/*============ If logo is on the same line as navigation ============ */
{% unless section.settings.nav_below_logo or section.settings.show_header_lines == false %}
.site-header .grid--full {
border-bottom: 1px solid {{ settings.color_borders }};
padding-bottom: 10px;
}
{% endunless %}
{% unless section.settings.nav_below_logo %}
@media screen and (min-width: 1200px) {
.site-nav {
text-align: right!important;
}
}
{% endunless %}
{% if section.settings.show_announcement or section.settings.header_search_enable %}
{% comment %}
Add social links to header
{% endcomment %}
{% comment %}
{% include 'social-links' %}
{% endcomment %}
{% if section.settings.show_announcement %}
{% elsif section.settings.header_search_enable %}
{% include 'search-bar' with 'header' %}
{% endif %}
{% endif %}
{% if shop.customer_accounts_enabled %}
{% if customer %}
-
{{ 'layout.customer.account' | t }}
-
{{ 'layout.customer.log_out' | t | customer_logout_link }}
{% else %}
-
{{ 'layout.customer.log_in' | t | customer_login_link }}
- {{ 'layout.customer.or' | t }}
-
{{ 'layout.customer.create_account' | t | customer_register_link }}
{% endif %}
{% endif %}
{% if section.settings.header_search_enable %}
{% if section.settings.show_announcement %}
{% include 'search-bar' with 'header' %}
{% endif %}
{% endif %}
{% include 'mobile-nav' with linklists[section.settings.nav_menu] %}
{% if section.settings.nav_below_logo %}
{% include âsite-navâ with linklists[section.settings.nav_menu] %}
{% else %}
{% include âsite-navâ with linklists[section.settings.nav_menu] %}
{% endif %}
follow this path:
Themes => edit code => asset => theme.scss.liquid
and add this code to bottom of the file theme.scss.liquid
@media(max-width: 768px) {
.site-header .wrapper .grid__item {
display: flex;
float: none;
}
.site-header .wrapper .grid__item {
.site-header__logo,
.call {
width: 100%;
}
}
.site-header .wrapper .grid__item .site-header__logo a {
padding-top: 0!important;
}
.site-header .site-header__logo {
width: 100%;
}
}
@Duxburys
I developed some custom code for you. That is how it is gonna look like:
- In your Shopify Admin go to online store > themes > actions > edit code
- In your theme.liquid file, find the (press CTRL + F or command + F on Mac)
- paste this code right above the tag:
Let me know if it works.
1 Like
Thank you so much. Its worked perfectly!
Youâre very welcome!
Please donât forget to press the button âAccept as solutionâ below my answer to help other people in the community with similar issues.
Wishing you a great day!