Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Dante › Social share links not opening in new window
New Landing › How can we help? › Themeforest Theme Support › Dante › Social share links not opening in new window
- This topic has 18 replies, 4 voices, and was last updated 9 years by Swift Ideas – Ed.
-
Posted in: Dante
-
April 13, 2015 at 3:59 pm #164776
The social share links don’t seem to open up in a new window. Looking at the code, being that there are specifications in there for height and width, it seems it should open in a new window. I was able add to the a link to make it target blank, but even that just opens a new tab, rather than a new window.
I’ve seen this topic brought up in the past, but never really a definitive answer I don’t believe.
April 13, 2015 at 4:47 pm #164798Hi,
Can you provide us the link to your site?
-Rui
April 13, 2015 at 4:54 pm #164801This reply has been marked as private.April 14, 2015 at 12:02 pm #165029Hi,
Where is social share links at this page http://54.145.187.224/on-demand/what-makes-a-man/.Thanks
MohammadApril 14, 2015 at 8:05 pm #165148This reply has been marked as private.April 15, 2015 at 2:29 am #165179Hi,
I see only share this text but dont see any share icons.
Thanks
MohammadApril 15, 2015 at 2:38 am #165180This reply has been marked as private.April 15, 2015 at 3:49 am #165184Hi,
Please open to edit shortcodes.php file at /dante/swift-framework/Find this code:- function sf_social_share() { global $post; $title = get_the_title(); $permalink = get_permalink(); $image = wp_get_attachment_url(get_post_thumbnail_id()); $excerpt = strip_tags(get_the_excerpt()); $share_output = ""; $share_output .= '<div class="share-links curved-bar-styling clearfix">'; $share_output .= '<div class="share-text">'.__("Share this:", "swiftframework").'</div>'; $share_output .= '<ul class="social-icons">'; $share_output .= '<li class="facebook"><a href="http://www.facebook.com/sharer.php?u='.$permalink.'" class="post_share_facebook" onclick="javascript:window.open(this.href, "", "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=220,width=600");return false;"><i class="fa-facebook"></i><i class="fa-facebook"></i></a></li>'; $share_output .= '<li class="twitter"><a href="https://twitter.com/share?url='.$permalink.'" onclick="javascript:window.open(this.href, "", "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=260,width=600");return false;" class="product_share_twitter"><i class="fa-twitter"></i><i class="fa-twitter"></i></a></li> '; $share_output .= '<li class="googleplus"><a href="https://plus.google.com/share?url='.$permalink.'" onclick="javascript:window.open(this.href, "", "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600");return false;"><i class="fa-google-plus"></i><i class="fa-google-plus"></i></a></li>'; $share_output .= '<li class="pinterest"><a href="http://pinterest.com/pin/create/button/?url='.$permalink.'&media='.$image.'&description='.$title.'" onclick="javascript:window.open(this.href, "", "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=320,width=600");return false;"><i class="fa-pinterest"></i><i class="fa-pinterest"></i></a></li>'; $share_output .= '<li class="mail"><a href="mailto:?subject='.urlencode($title).'&body='.$excerpt.' '.$permalink.'" class="product_share_email"><i class="ss-mail"></i><i class="ss-mail"></i></a></li>'; $share_output .= '</ul>'; $share_output .= '</div>'; return $share_output; } Change with:- function sf_social_share() { global $post; $title = get_the_title(); $permalink = get_permalink(); $image = wp_get_attachment_url(get_post_thumbnail_id()); $excerpt = strip_tags(get_the_excerpt()); $share_output = ""; $share_output .= '<div class="share-links curved-bar-styling clearfix">'; $share_output .= '<div class="share-text">'.__("Share this:", "swiftframework").'</div>'; $share_output .= '<ul class="social-icons">'; $share_output .= '<li class="facebook"><a target="_blank" href="http://www.facebook.com/sharer.php?u='.$permalink.'" class="post_share_facebook" onclick="javascript:window.open(this.href, "", "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=220,width=600");return false;"><i class="fa-facebook"></i><i class="fa-facebook"></i></a></li>'; $share_output .= '<li class="twitter"><a target="_blank" href="https://twitter.com/share?url='.$permalink.'" onclick="javascript:window.open(this.href, "", "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=260,width=600");return false;" class="product_share_twitter"><i class="fa-twitter"></i><i class="fa-twitter"></i></a></li> '; $share_output .= '<li class="googleplus"><a target="_blank" href="https://plus.google.com/share?url='.$permalink.'" onclick="javascript:window.open(this.href, "", "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600");return false;"><i class="fa-google-plus"></i><i class="fa-google-plus"></i></a></li>'; $share_output .= '<li class="pinterest"><a target="_blank" href="http://pinterest.com/pin/create/button/?url='.$permalink.'&media='.$image.'&description='.$title.'" onclick="javascript:window.open(this.href, "", "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=320,width=600");return false;"><i class="fa-pinterest"></i><i class="fa-pinterest"></i></a></li>'; $share_output .= '<li class="mail"><a target="_blank" href="mailto:?subject='.urlencode($title).'&body='.$excerpt.' '.$permalink.'" class="product_share_email"><i class="ss-mail"></i><i class="ss-mail"></i></a></li>'; $share_output .= '</ul>'; $share_output .= '</div>'; return $share_output; }
Thanks
MohammadApril 15, 2015 at 3:22 pm #165393I’ve already attempted adding target=”_blank” to the a links as I mentioned in my original post. This just makes new tabs open, rather than a new window. Specifying a height and weight should force a new window to open, but it doesn’t seem to be working in this case.
Thanks
April 15, 2015 at 3:29 pm #165395Hi,
It seems all fine.
The new tabs you talk about it’s called a window it doesn’t exist any other concept. It’s the browser that display in tabs or not.
-Rui
April 15, 2015 at 3:33 pm #165399This reply has been marked as private.April 15, 2015 at 3:42 pm #165405yes, you are right(sorry didn’t read everything) it should open in a resized window, like in our demo.
Maybe some plugin conflict. Can you try to disable all plugins, clear the cache and try again.
-Rui
April 15, 2015 at 3:53 pm #165409No problem. Just tried disabling all plug-ins and there was no change. I did also try pasting in the whole block of code that Mohammad put in before and this didn’t change anything either.
April 15, 2015 at 3:57 pm #165412This reply has been marked as private.April 15, 2015 at 4:12 pm #165415This reply has been marked as private. -
Posted in: Dante
You must be logged in to reply to this topic.