Header social links open in new tab

Kris12
Visitor
1 0 0

Hi

 

I would like my social links that is on the header to be open in a new tab. I dont know much about coding. 

I've seen other similar threads but it is all about footer codes and I couldn't find the "target" for the social links. I read that it has to be set to blank or something but can't seem to find it. 

 

Thank you in advance! 

Replies 2 (2)

oscprofessional
Shopify Partner
15843 2371 3073
<p>Check out <a href="https://www.freecodecamp.org/" target="_blank">freeCodeCamp</a>.</p>

Hi,

this is a example 

refer this code & edit your code 

Get pass your Store Core Web Vital Free Speed Optimization Audit, Chat on WhatsApp | Skype : oscprofessionals-87 | Email: pallavi@oscprofessionals.com | Custom Pricing Wholesale App : Free | Hire us | Guaranteed Site Speed Optimization | Website Free Audit | Shopify Theme Customization | Build Shopify Private App | Shopify SEO | Digital Marketing

kldlaz
Excursionist
82 0 6

add this to your theme.liquid

at the bottom


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

it works for me supply theme