Social media links not opening in new window

New Member
1 0 0

PopIQsnacks.com

On product pages (any product) social links do not < target="_blank"> to open in new tab. I'm using the Parallex theme, and while the social-icons.liquid all contain that target, I think the issue maybe here? social-buttons.liquid

The code is as below, and I tried inserting that (target="_blank") code in the <a href> brackets, but to no avail.  

{% capture current_url %}{% if social-buttons == 'article' %}{{ shop.url }}{{ article.url }}{% else %}{{ canonical_url }}{% endif %}{% endcapture %}

{% capture buttons %}
<ul class="socialButtons">
{% capture title %}{% if social-buttons == 'article' %}{{ article.title | strip_html }}{% else %}{{ product.title | strip_html }}{% endif %}{% endcapture %}
{% capture twitter_name %}{{ settings.twitter_link | split: 'twitter.com/' | last }}{% endcapture %}
<li><span>{{ 'layout.social_sharing.title' | t }}:</span></li>
<li><a href="https://twitter.com/intent/tweet?text={{ title | truncate: 30 | url_escape }} &url={{ current_url }}{%- if twitter_name != blank -%}&via={{ twitter_name }}{%- endif -%}" class="icon-twitter" title="{{ 'layout.social_sharing.twitter_title' | t }}" ></a></li>
<li><a href="https://www.facebook.com/sharer/sharer.php?u={{ current_url }}" class="icon-facebook" title="{{ 'layout.social_sharing.facebook_title' | t }}"></a></li>
{% if social-buttons == 'article' %}
<li><a data-pin-do="skipLink" class="icon-pinterest" title="{{ 'layout.social_sharing.pinterest_title' | t }}" href="http://pinterest.com/pin/create/button/?url={{ current_url }}&description={{ article.content | strip_html | truncate: 240 }}&media={% if article.image %}{{ article.image | img_url: '600x' }}{% else %}{% assign my_image_url=article.content | escape %}{% if my_image_url contains '&lt;img' %}{% assign my_image_url = my_image_url | split: 'src=&quot;' %}{% assign my_image_url = my_image_url[1] | split: '&quot;' %}{% assign my_image_url = my_image_url[0] | remove: '//cdn' %}{% assign my_image_url = my_image_url | remove: 'http:http://' %}{% assign my_image_url = my_image_url | remove: 'https:' %}{{ my_image_url | prepend: 'http://cdn'}}{% endif %}{% endif %}"></a></li>
{% else %}
<li><a data-pin-do="skipLink" class="icon-pinterest" title="{{ 'layout.social_sharing.pinterest_title' | t }}" href="https://pinterest.com/pin/create/button/?url={{ current_url }}&description={{ title | strip_html | truncate: 240 }}&media=https:{{ product.featured_image.src | product_img_url: '600x' }}"></a></li>
{% endif %}
<li><a href="mailto:?subject={{ 'layout.social_sharing.email_subject' | t: title: title }}&amp;body={{ 'layout.social_sharing.email_message' | t: title: title, name: shop.name }}%0D%0A%0D%0A{{ current_url }}" class="icon-mail" title="{{ 'layout.social_sharing.email_title' | t }}"></a></li>
</ul>
{% endcapture %}

{% if social-buttons == 'article' and section.settings.display_social_buttons %}
{{ buttons }}
{% elsif social-buttons == 'product' and section.settings.display_social_buttons %}
{{ buttons }}
{% endif %}

 

0 Likes