All things Shopify and commerce
Hi, I have a custom header and a theme outside of shopify, hence the default feature of clicking the logo to get redirected to the homepage is not there. I know that it has to be done with the coding method.
Can someone please help me with code and also where exactly should I put?
Thanks in advance!
Hi @beyondgrateful ,
You can try the following steps to make your logo redirect to Homepage when clicking:
- In Shopify admin, go to Online Store > Themes > Edit code
- In the header.liquid file, you can insert the below code:
<script> $(document).ready(function() { // Get the logo element var logo = $("#logo"); // When the logo is clicked, redirect to the homepage logo.click(function() { window.location = "/"; }); }); </script>
- Save your changes and check your store front to see if it works.
Hope this can help.
You should find your logo image inside the file header.liquid (or similar) and adjust the code like this
<a href="/">
<img src="Your logo image url">
</a>
Hope it helps!
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024