Jump to content

Homepage header customization stopped working

Go to solution Solved by tuanphan,

Recommended Posts

With an image in the background, I need the logo on my homepage to be white, I had added some custom code to achieve this but it no longer works. Not sure what happened, perhaps an update from Squarespace.
This is the code I currently have:
 

<script>
 window.onload = function() {
   document.querySelectorAll('.header-title-logo img')[0].src = 'https://static1.squarespace.com/static/5fd925449f6d8f67d97815cb/t/6043b664c343a45fe3d1e965/1615050340420/Graham-Green-white-cropped-150.png';
 };
</script>

Hoping someone can point me in the right direction to resolve this issue.

Link to comment
  • Replies 4
  • Views 383
  • Created
  • Last Reply

Top Posters In This Topic

Actually you can replace that code with this to change to new logo. The code will apply for both desktop + mobile

<style>
  header#header img {
  	content: url(https://static1.squarespace.com/static/5fd925449f6d8f67d97815cb/t/6043b664c343a45fe3d1e965/1615050340420/Graham-Green-white-cropped-150.png);
  }
</style>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
4 hours ago, tuanphan said:

Actually you can replace that code with this to change to new logo. The code will apply for both desktop + mobile

<style>
  header#header img {
  	content: url(https://static1.squarespace.com/static/5fd925449f6d8f67d97815cb/t/6043b664c343a45fe3d1e965/1615050340420/Graham-Green-white-cropped-150.png);
  }
</style>

 

This works great, unfortunately, I have a mobile-specific logo so it breaks mobile. I could have sworn that was not the case with the original code, but looking at it now, I could be wrong.

Link to comment
  • Solution
20 hours ago, GrahamG said:

This works great, unfortunately, I have a mobile-specific logo so it breaks mobile. I could have sworn that was not the case with the original code, but looking at it now, I could be wrong.

If target desktop only, use this code

<style>
  .header-display-desktop img {
  	content: url(https://static1.squarespace.com/static/5fd925449f6d8f67d97815cb/t/6043b664c343a45fe3d1e965/1615050340420/Graham-Green-white-cropped-150.png);
  }
</style>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 7/4/2023 at 4:52 AM, tuanphan said:

If target desktop only, use this code

<style>
  .header-display-desktop img {
  	content: url(https://static1.squarespace.com/static/5fd925449f6d8f67d97815cb/t/6043b664c343a45fe3d1e965/1615050340420/Graham-Green-white-cropped-150.png);
  }
</style>

 

Perfect! Thank you so much!

Link to comment

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.