I am using the Sense theme and need the coding to open external links in a new tab. I know about the solution from OSCProfessional, but cannot read the code because the picture is blurry. Can anyone help with this? It’s turning into a whole day project. I’ve tried the code and it doesn’t work. I don’t have a theme.js or a theme.js.liquid, but I have an assets/theme-editor.js or a layout/theme.liquid. My brain hurts. I would upload a screen shot, but I don’t have the right file types. Thank you!
Topic summary
Opening external links in a new tab for the Shopify Sense theme.
- Problem: The store owner wanted all external links to open in a new tab but couldn’t use an existing (blurry) image-based solution. They lacked theme.js/theme.js.liquid and only saw assets/theme-editor.js and layout/theme.liquid.
- Fix provided: Via Online Store > Edit Code, open layout/theme.liquid and insert the provided code just above the closing tag. (The exact snippet isn’t shown in the thread extract.)
- Outcome: After adding the code, external links behaved as desired; the requester confirmed it worked and expressed relief.
- Status: Resolved. No outstanding questions; the helper offered further assistance if needed.
Hey @JustCats
Follow these Steps:
-
Go to Online Store
-
Edit Code
-
Find theme.liquid file
-
Add the following code in the bottom of the file above tag
If I managed to help you then, don’t forget to Like it and Mark it as Solution!
Best Regards,
Moeed
1 Like
I almost cried when it finally worked. Thanks for saving the day!
1 Like
Thank you for your reply. I’m glad to hear that the solution worked well for you. If you require any more help, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated.
1 Like