Hi, can you please make all my social media links open in a new tab.
Thank you in advance!
url: hygiadental.com
pw: myown
Hi, can you please make all my social media links open in a new tab.
Thank you in advance!
url: hygiadental.com
pw: myown
Hello @Anonymous
Login on your Admin ā Go to the Online store ā Edit theme code https://prnt.sc/jUfNuFNulliN
Under the theme edit find main-password-footer https://prnt.sc/WEOtVONYg4Ip and Open the file on click of this https://prnt.sc/RSb6KzIQPHO3
Now you can see there are <a tag for different social media icons you have to add the target=ā_blankā on it.
Before: https://prnt.sc/6qza0xeQNalY
After add of target=ā_blankā it will be look like this https://prnt.sc/-lY_LBOl7E-u
You have to do the same in all the social media link to open it in the new tab and save the file.
AND after entering the password there is a social media icon on footer as well so for that you have to find the.
social-icons https://prnt.sc/Uprzp5Evw6ZX and add the target=ā_blankā in all the <a tag in the file to open it in new tab.
If you require further help to optimize your store, please donāt hesitate to reach out.
If you find this information useful, a Like would be greatly appreciated.
And if this solves the problem, please Mark it as Solution!
If you want me to help you on this if you donāt know about the code then let me know. I am happy to help you.
@Anonymous Please follow the below steps to open the social media links in new tab. Let us know whether it is helpful for you.
class="link list-social__link" target='_blank
Now the social media links will open on new tab.
Please provide your support by click āLikeā and āAcceptedā if our solution works for you. Thanks for your support.
It worked!!! Thanks a lot ![]()
I found a way to do this without editing the theme code directly. This worked in the Dawn theme, and with small modifications, it should work on other Shopify themes too.
In your Shopify customizer, go to your Footer section.
Add a new Custom Liquid block.
Remove all padding so the block wonāt be visible on the storefront.
Paste this code into the Liquide Code block:
<script>
document.querySelectorAll('.footer__list-social .list-social__link').forEach(link => {
link.setAttribute('target', '_blank');
link.setAttribute('rel', 'noopener noreferrer');
});
</script>
Now all your social media links in the footer will automatically open in a new tab.
Let me know if that also worked for you.