Jump to content

Change link of the logo (mobile and desktop)

Recommended Posts

Posted

Hi all, 

I would like the logo in the header to link to an external page. I tried to add to inject the following code in the header section:

<script>
  document.querySelector('.header-title-logo a').setAttribute('href', 'https://www.radici.se/');
</script>

 but it doesn't work. Can someone pleae help me?

Posted

Hi,

the logo in my header should point to a page external to my website. I have tried to inject the following code:

<script> 
  document.querySelector('.logo-image a').setAttribute('href', '/https://www.google.com/');
</script>

but did not work. Can someone help me?

Posted (edited)
25 minutes ago, MaBa00 said:

Hi,

the logo in my header should point to a page external to my website. I have tried to inject the following code:

<script> 
  document.querySelector('.logo-image a').setAttribute('href', '/https://www.google.com/');
</script>

but did not work. Can someone help me?

 

Add these code on Code Injection > Header Section.

<script src="https://code.jquery.com/jquery-3.6.3.min.js"></script>
<script>
$(function(){
   $('.header-title-logo a').attr("href", "https://www.google.com");
});
</script>

 

 

Edited by Web_Solutions

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.