Jump to content

How to add a second logo to my squarespace header in 7.1?

Recommended Posts

  • 4 months later...
19 hours ago, artpimpress said:

I have a similar issue. We want to add an icon/logo to the upper left side of the header as well as the text version currently shown on the center. Any workaround for this? Thanks

https://olive-dog-ss3h.squarespace.com/

password: thorne

Add to Settings > Advanced > Code Injection > Header

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
  $(document).ready(function() { 
		$('<a href="#" class="tlogo"><img src="https://cdn.pixabay.com/photo/2021/01/09/12/28/tulips-5902188__340.jpg"/></a>').appendTo('[data-nc-container="top-left"]');
	});
</script>
<style>
  a.tlogo img {
    width: 100px;
}
</style>

image.thumb.png.a1418a7222e8b41b0841b7e7801c9d36.png

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 5/14/2021 at 7:40 AM, tuanphan said:

Add to Settings > Advanced > Code Injection > Header


<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
  $(document).ready(function() { 
		$('<a href="#" class="tlogo"><img src="https://cdn.pixabay.com/photo/2021/01/09/12/28/tulips-5902188__340.jpg"/></a>').appendTo('[data-nc-container="top-left"]');
	});
</script>
<style>
  a.tlogo img {
    width: 100px;
}
</style>

image.thumb.png.a1418a7222e8b41b0841b7e7801c9d36.png

That worked perfectly. Thank you so much!

Link to comment
  • 2 months later...

@sarahprime

sure, you can do this with just CSS, no javascript required. CSS has a property called content and a pseudo-selector ::after. You have to be careful with this as squarespace might legitimately use it themselves, but if you find the right class name or id selector you can do it easily enough. this should work. change the URL as needed.

put this in a code block somewhere on the page. or remove the <style> tags and put it in the site-wide CSS.

<style>
  
.header-actions::after {
  content:'';
  display:inline-block;
  width:50px;
  height:50px;
  margin-left:20px;
  background:url("https://images.squarespace-cdn.com/content/v1/600f62fff88eb259bc0f448d/1627162275205-1LJBGHMXHDN93NK9WR3F/square-avatar.png") no-repeat 0 0; 
  background-size:100%;
 
 }
</style>

 

Dave Hart. Software/Technology Consultant living in London. buymeacoffee 

Link to comment
  • 3 weeks later...

@iamdavehart Thanks for that, is it possible to add the logo to the top left rather than top right? in screenshot below, on the left the Gilead logo is part of the background image but that becomes a problem with different screen resolutions. The logo on the right is your code, id like to make go on the left and replace the background with a blank one. TYIA!1928475549_ScreenShot2021-08-18at11_44_06pm.thumb.png.aa351b354bbd2d5473bf229ef379085e.png

Link to comment

sure. just need to change the element it's putting the content into, and change it from after to before as its going on the left. if you're on 7.1 it will depend on how you've laid out your header. this should probably work, but if it doesn't then try changing ".header-title-nav-wrapper" to ".header-actions.header-actions--left"

<style>
  
.header-title-nav-wrapper::before {
  content:'';
  display:inline-block;
  width:50px;
  height:50px;
  margin-right:20px;
  background:url("https://images.squarespace-cdn.com/content/v1/600f62fff88eb259bc0f448d/1627162275205-1LJBGHMXHDN93NK9WR3F/square-avatar.png") no-repeat 0 0; 
  background-size:100%;
 
 }
</style>

change width and height and background url accordingly.

 

Edited by iamdavehart

Dave Hart. Software/Technology Consultant living in London. buymeacoffee 

Link to comment
  • 2 months later...
On 8/18/2021 at 4:38 PM, iamdavehart said:

sure. just need to change the element it's putting the content into, and change it from after to before as its going on the left. if you're on 7.1 it will depend on how you've laid out your header. this should probably work, but if it doesn't then try changing ".header-title-nav-wrapper" to ".header-actions.header-actions--left"

<style>
  
.header-title-nav-wrapper::before {
  content:'';
  display:inline-block;
  width:50px;
  height:50px;
  margin-right:20px;
  background:url("https://images.squarespace-cdn.com/content/v1/600f62fff88eb259bc0f448d/1627162275205-1LJBGHMXHDN93NK9WR3F/square-avatar.png") no-repeat 0 0; 
  background-size:100%;
 
 }
</style>

change width and height and background url accordingly.

 

@iamdavehart For some reason this didn't work for me, any idea how to get a small extra logo on the left hand side of the header, running in line with the search button? Website is: warners-stores.co.uk

Thanks!

Link to comment
23 hours ago, louis1996 said:

@iamdavehart For some reason this didn't work for me, any idea how to get a small extra logo on the left hand side of the header, running in line with the search button? Website is: warners-stores.co.uk

Thanks!

Add it here? Logo is clickable or non-clickable?

image.thumb.png.8d70e30782604beb248df0f4602138c7.png

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 10/27/2021 at 12:07 AM, Vncent said:

Hi! I'm also trying to use the code @iamdavehart posted, but want to position my secondary logo in the center of the header while keeping my main logo on the left. What should I change? Thanks!

 

__q.thumb.jpg.7b547b49c2d409455beda0f351f74a0d.jpg

Hi. What is site url? We can check easier

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 11/2/2021 at 10:43 PM, louis1996 said:

@tuanphan Are you able to help with this? thank you!

Add to Last Line in Code Injection > Footer

<script>
  $(document).ready(function() { 
		$('<a href="https://beaverhero.com" class="logo1"><img src="https://content.invisioncic.com/p289038/monthly_2021_11/GEF_30Years_Logo_ARTTransparent-01.thumb.png.2b8888731ad6854ebf20eedc7da6ee33.png"/></a>').insertBefore('.header-title-nav-wrapper');
	});
</script>
<style>
  a.logo1 img {
    width: 100px;
}
</style>

Replace beaverhero, image url with new link/image you want.

image.thumb.png.5dfd92c40710f24334b185bce9cc9b03.png

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 11/6/2021 at 2:23 AM, tuanphan said:

Add to Last Line in Code Injection > Footer

<script>
  $(document).ready(function() { 
		$('<a href="https://beaverhero.com" class="logo1"><img src="https://content.invisioncic.com/p289038/monthly_2021_11/GEF_30Years_Logo_ARTTransparent-01.thumb.png.2b8888731ad6854ebf20eedc7da6ee33.png"/></a>').insertBefore('.header-title-nav-wrapper');
	});
</script>
<style>
  a.logo1 img {
    width: 100px;
}
</style>

Replace beaverhero, image url with new link/image you want.

image.thumb.png.5dfd92c40710f24334b185bce9cc9b03.png

@tuanphan That worked great, is there a way to make it only apply to desktop? As on mobile it is throwing the navigation button off the screen. Thank you!

Link to comment
On 11/8/2021 at 4:53 PM, louis1996 said:

@tuanphan That worked great, is there a way to make it only apply to desktop? As on mobile it is throwing the navigation button off the screen. Thank you!

Use this new code

<script>
  $(document).ready(function() { 
		$('<a href="https://beaverhero.com" class="logo1"><img src="https://content.invisioncic.com/p289038/monthly_2021_11/GEF_30Years_Logo_ARTTransparent-01.thumb.png.2b8888731ad6854ebf20eedc7da6ee33.png"/></a>').insertBefore('.header-display-desktop .header-title-nav-wrapper');
	});
</script>
<style>
  a.logo1 img {
    width: 100px;
}
</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

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.