Hi there,
Maybe it’s my imagination, but I thought social media share buttons at the bottom of the blog posts were supposed to open pop-up windows. We just noticed that they are instead opening a new tab.
We have recreated this on multiple computers with both Chrome and Firefox.
We are running the latest WP and Enfold.
Thanks!
Hey perfectword,
Sorry for the late reply, opening a new tab is correct. I don’t recall them opening popups.
Best regards,
Mike
Thanks!
I find the new tab awkward. Any advice on how to turn those links into pop up browser windows?
Thanks again!
Hi,
I found that adding the attribute:
onclick="window.open(this.href, 'windowName', 'width=1000, height=700, left=24, top=24, scrollbars, resizable'); return false;"
forces a popup.
Try adding this code to the end of your functions.php file in Appearance > Editor:
Please see below
Best regards,
Mike
Thanks for the solution! Pop-up works great–much better.
For whatever reason (I couldn’t figure out exactly why), though, your code made all of the links on the page pop up, not just the share links. I ended up using this code and now it’s only getting the share links:
function social_popup(){
?>
<script>
(function($){
jQuery(window).load(function(){
$(document).ready(function(){
$(".av-share-link").find("a").attr("onclick","window.open(this.href, 'windowName', 'width=670, height=2000, left=24, top=24, scrollbars, resizable'); return false;");
});
});
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'social_popup');