×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Nicole Patten
Added: Feb 19, 2016 6:59 PM
Views: 16
share links wordpress
  1. <a class="popup" href="http://www.facebook.com/sharer/sharer.php?u=<?php print(urlencode(get_permalink())); ?>" target="_blank"><img src="<?php echo get_template_directory_uri(); ?>/images/social/fbook-black.png" onclick="ga('send', 'event', 'Share Button', 'Clicked', 'Facebook');"></a>
  2.                         <a class="popup" href="http://twitter.com/intent/tweet?status=FWx/FedEx+<?php print(urlencode(get_permalink())); ?>" target="_blank"><img src="<?php echo get_template_directory_uri(); ?>/images/social/twitter-black.png" onclick="ga('send', 'event', 'Share Button', 'Clicked', 'Twitter');"></a>
  3.                         <a class="popup" href="http://pinterest.com/pin/create/bookmarklet/?media=http://amgfedex.staging.wpengine.com/wp-content/themes/fedex/images/hero2-left-bg.jpg&url=<?php print(urlencode(get_permalink())); ?>&is_video=false&description=FWx/FedEx" target="_blank"><img src="<?php echo get_template_directory_uri(); ?>/images/social/pinterest-black.png" onclick="ga('send', 'event', 'Share Button', 'Clicked', 'Pinterest');"></a>
  4.                         <a class="popup" href="http://www.tumblr.com/share?v=3&u=<?php print(urlencode(get_permalink())); ?>&t=FWx/FedEx" target="_blank"><img src="<?php echo get_template_directory_uri(); ?>/images/social/tumblr-black.png" onclick="ga('send', 'event', 'Share Button', 'Clicked', 'Tumblr');"></a>
  5.                         <a class="popup" href="https://plus.google.com/share?url=<?php print(urlencode(get_permalink())); ?>" target="_blank"><img src="<?php echo get_template_directory_uri(); ?>/images/social/google-black.png" onclick="ga('send', 'event', 'Share Button', 'Clicked', 'Google Plus');"></a>
  6.  
  7.  
  8.                 //share links open in popup
  9.                 $('.popup').click(function (event) {
  10.                    event.preventDefault();
  11.                    window.open($(this).attr("href"), "popupWindow", "width=600,height=600,scrollbars=yes");
  12.                 });