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>
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024