how to add a logo to other pages only (Dawn theme)

Fabianoo
New Member
15 0 0

Hi 

I would like to add my logo to other pages instead of the home page. 

Thanks!

Replies 10 (10)

Liqiud_xPert_SJ
Shopify Partner
800 99 128

Hi @Fabianoo welcome to the Shopify Community,

 

YOu can use the below code if you have knowledge how to deal with liquid code

 

{% if template.name != "index" %} 
Your Logo Code will be place here
{% endif %}

 

Online Store > Code Edit > Header. liquid > find the logo wrap div and place that inside above code.

 

2024-02-02 10_14_54-bisabrandpk · Edit ~ Dawn · Shopify.png

Thanks

- If you need any technical assistance, feel free to send me a DM. You no longer have to search for answers without getting a response.
- Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
- Your Shopify Solution Specialist For further discussion contact: Email ID- Liqud_3xPert_SJ OR Whatsapp
- Buy a Coffee for me to get more frequently help 🙂
- Hire Me to unlock the full potential of your e-commerce store Now 🙂

BrainStation23
Shopify Partner
303 50 48

Hello @Fabianoo. In dawn theme, if you add logo from theme settings, it will appear in header section. This means, it will be available in all the pages.
However, if you want to show the logo in other pages except for homepage, you need to update your liquid code. You can try the following code.

In your header.liquid file,

{{ settings.logo | image_url: width: 600 | image_tag:
class: 'header__heading-logo motion-reduce',
widths: widths,
height: logo_height,
width: settings.logo_width,
alt: logo_alt,
sizes: sizes,
preload: true
}}


replace the above code with the code below:

{% if request.path != routes.root_url %}
{{ settings.logo | image_url: width: 600 | image_tag:
class: 'header__heading-logo motion-reduce',
widths: widths,
height: logo_height,
width: settings.logo_width,
alt: logo_alt,
sizes: sizes,
preload: true
}}
{% endif %}


If you find and difficulty or have any queries, please let me know.

Faisal Ahmed | Brain Station 23
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution

Brain Station 23 PLC
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Email: js.team@brainstation-23.com
Fabianoo
New Member
15 0 0

Hi Faisal,

Thanks for the suggestion. I'm unable to locate the specific code on my header.liquid file. Are there any way i can search easily? Im using macbook 

Fabianoo
New Member
15 0 0

It doesn't work though

Liqiud_xPert_SJ
Shopify Partner
800 99 128

Hi @Fabianoo 

 

I can do it for you if you are not familiar with liquid code.

 

Thanks

- If you need any technical assistance, feel free to send me a DM. You no longer have to search for answers without getting a response.
- Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
- Your Shopify Solution Specialist For further discussion contact: Email ID- Liqud_3xPert_SJ OR Whatsapp
- Buy a Coffee for me to get more frequently help 🙂
- Hire Me to unlock the full potential of your e-commerce store Now 🙂
BrainStation23
Shopify Partner
303 50 48

Hi @Fabianoo. I'm attaching some screenshots.

 

home.PNG

From the above image, you can see I've added an logo from theme settings, but it is not showing in homepage.

collection.PNG

But here in collection page, the logo is appearing.

Brain Station 23 PLC
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Email: js.team@brainstation-23.com
BrainStation23
Shopify Partner
303 50 48

And you need to put the code here:

code.PNG

If you have any confusion, please let me know.

 

Faisal Ahmed | Brain Station 23
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution

Brain Station 23 PLC
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Email: js.team@brainstation-23.com
Fabianoo
New Member
15 0 0

It doesnt work though...

BrainStation23
Shopify Partner
303 50 48

@Fabianoo. Can you please share your code screenshot? If possible, your store URL also.

 

Faisal Ahmed | Brain Station 23

Brain Station 23 PLC
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Email: js.team@brainstation-23.com

Vinsinfo
Shopify Partner
247 90 82
Hi, Hopefully below instruction will help you, please let me know if you have any questions
 
1. We need to add condition on header.liquid file to achieve this.
2. From the store admin panel, go to "Online store" -> "Themes" -> "Edit code".
3. Go to header.liquid usign the search bar.
header-code.png

Step3: Again paste the code {%- if request.page_type != 'index' -%} before the line "{%- if section.settings.logo_position == 'middle-center' -%}"

 

Step4: Paste the code {%- endif -%} before the "header__icons" section in the attached screenshot.

header-code-1.png