Jump to content

Make Social Links Open in Same Tab

Go to solution Solved by Lesum,

Recommended Posts

Posted

I would like to remove the target="_blank" so the social links open in the same tab instead of a new tab. Does anyone know what I can do? I tried Squarespace helpdesk, but they would not help. TIA!

Screenshot 2024-06-11 at 4.14.22 PM.png

  • Replies 2
  • Views 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • Solution
Posted

@Melibau Try adding this code snippet under Website > Pages > Website Tools > Code Injection > Header:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
	$('.header-actions-action.header-actions-action--social a').attr('target','_self');
});
</script>

Let me know how it goes. Thanks! 

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

  • 4 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.