Impulse Theme Redirect

Impulse Theme Redirect

Kim_Thomas
Visitor
1 0 0

Awhile back I hired someone to make sure all links that are external should open up into a new page, however, ALL my pages open up to a new page. I don't want this. 

 

I just want all my external links to open up to a new page. Can someone please share how to do this. Please list all steps so it's easy to follow. 

 

Thank you,

Replies 2 (2)

Bundler-Manuel
Astronaut
1106 51 131

Hello there Kim @Kim_Thomas  I suggest you try out this code here

<script>
document.addEventListener('DOMContentLoaded', function(){
var links = document.links;
for (let i = 0, linksLength = links.length ; i < linksLength ; i++) {
if (links[i].hostname !== window.location.hostname) {
links[i].target = '_blank';
links[i].rel = 'noreferrer noopener';
}
}
});
</script>

Emmanuel
Please let me know if it works by marking it as a solution!
Bundler - Product Bundles app, a great bundle app for Shopify, with glowing user testimonials and a free plan.

tim
Shopify Partner
4702 573 1700

Need to see your site to understand how it works now and why it's not the way you wanted it.

The code suggested above may work for unmodified theme, but may not work for yours.

If my post is helpful, hit the thumb up button -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com