Add custom icon to header

Add custom icon to header

DGQs
Tourist
15 0 3

Hi there,

 

Next to my logo, I would like to add a custom icon to my header.

I am using the Crave Theme. How can I do this please? 

Replies 5 (5)

BSSCommerce-B2B
Shopify Partner
1480 422 482

@DGQs, Can you kindly share your store url and icon you want to add ?

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

DGQs
Tourist
15 0 3

dgqs.myshopify.com

password is damngood

DGQ_byFSS_kaarten_Tekengebied 1.png

Sweans
Shopify Partner
400 79 121

Hi @DGQs ,

Please follow the steps to display the icon in the header.

 

-Prepare the icon in svg or png format.

-Upload the icon to the Shopify store: Admin > Settings > Files.

-Then modify the header file header.liquid in Sections : Online Store > Themes > Actions > Edit code.

-Add the HTML next to the logo code. For example:

 

<div class="site-header__logo">
 {{ 'logo' | image_tag }} <!-- This is your logo -->
<img src="{{ 'your-icon.png' | asset_url }}" alt="Custom Icon" class="custom-header-icon" /> 
</div>

 

-Replace 'your-icon.png' with the actual filename of your uploaded icon.

-Add the code below to theme.css or theme.scss.liquid

 

.custom-header-icon { 
width: 30px; 
margin-left: 10px;
}

 

-Save the changes.

If you need further assistance, feel free to reach out!
If this solution works for you, please like the post and mark it as a solution!

Regards,
Sweans

- Was my reply helpful? Please Like and Accept the Solution or let me know by Buying me coffee!
- Want to modify or custom changes on store Hire me.
- Feel free to contact me at info@sweans.com regarding any help.
- To know more about me check out www.sweans.com

DGQs
Tourist
15 0 3

Hi Sweans, thank you so much already for this. It's not going smoothly just yet. I get the following notification. I was confused about where to place the first code within the right file. what do you mean with 'next to the logo code'? 

 

This is the code that I posted at the bottom of the header.liquid in sections: 

<div class="site-header__logo">
{{ 'logo' | image_tag }}
<img src="{{ 'https://cdn.shopify.com/s/files/1/0728/1183/9825/files/DGQ_byFSS_kaarten_Tekengebied_1.png?v=1726219...' | asset_url }}" alt="Custom Icon" class="custom-header-icon" />
</div>

 

The error is on the picture Screenshot 2024-09-13 at 11.38.05.png

DGQs
Tourist
15 0 3

I also want to make sure that the icon is instead of my current cart logo.

 

I Deleted all the code because it was difficult to keep editing with the remarks. I have a 'dot' on my cart now that i cannot seem to remove. Any ideas what went wrong please? Screenshot 2024-09-13 at 13.32.35.png