Open Navigation Link web address in a 'new window'

Danielle_Harshe
New Member
1 0 0

Hi, 

Can someone please help me? I need to know how to: Open Navigation Link web address in a 'new window'.

I found an old post on this topic, but the link to the "answer" is incomplete so is useless to me.

Thank you!

0 Likes
gina-gregory
Shopify Expert
710 48 169

I believe the code they're referring to is this:

<script type="text/javascript">
        jQuery('a[href^="http"]').not('a[href^="{{ shop.url }}"]').attr('target', '_blank');
 </script>

This requires that you have jQuery installed in your site and should be placed at the bottom of the theme.liquid file, but above the </body> tag. It will make any link that starts with "http" that is not a link to your shop URL open in a new window.

0 Likes
MJillur
New Member
2 0 0

Thanks @ 

0 Likes