Shopify themes, liquid, logos, and UX
Hello,
I'm currently working on optimising my website and would like to make a small adjustment to the social media links.
Currently, when users click on the social media icons in the announcement bar or footer, they open in the same window. However, I would prefer them to open in a new window or tab to ensure that visitors can easily return to my website after exploring my social media profiles.
Could you please assist me in configuring the social media links so that they open in a new window/tab?
This is my website: www.gastonduflos.com
Thank you for your attention to this matter.
Solved! Go to the solution
This is an accepted solution.
Hi @GASTY
- Go to Online Store -> Theme -> Edit code.
- Find the file Layouts/theme.liquid and paste the code below at the bottom of the file."
<script>
document.querySelectorAll('.list-social__link').forEach(function(link) {
link.setAttribute('target', '_blank');
});
</script>
Hi @GASTY
"Target="_blank" should be inside the <a> tag.
like this:
Thanks mate. I only want all the SOCIAL MEDIA ICONS to open on a new window, announcement bar and footer. Do you know how to achieve this? Thank you!
This is an accepted solution.
Hi @GASTY
- Go to Online Store -> Theme -> Edit code.
- Find the file Layouts/theme.liquid and paste the code below at the bottom of the file."
<script>
document.querySelectorAll('.list-social__link').forEach(function(link) {
link.setAttribute('target', '_blank');
});
</script>
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025