|
Twitter |
|
https://twitter.com/intent/tweet?url=URL&text=TITLE |
|
|
|
Facebook |
|
https://www.facebook.com/sharer/sharer.php?u=URL |
|
|
|
Pinterest |
|
https://pinterest.com/pin/create/button/?url=URL&media=IMG&description=TITLE |
|
|
|
LinkedIn |
|
https://www.linkedin.com/shareArticle?mini=true&url=URL&title=TITLE |
|
|
|
Email |
|
mailto:?subject=TITLE&body=URL |
|
|
|
PHP URL Encode |
|
<?php echo urlencode($var); ?> |
|
<?php |
|
$social_share_title = urlencode( get_the_title() ); |
|
$social_share_url = urlencode( get_permalink() ); |
|
?> |
|
|
|
Quick and Dirty Print() |
|
<a href="#" onclick="window.print();return false;"> |
|
|
|
Quick and Dirty Popup |
|
onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');return false;" |
|
|
|
Centered Unobstrusive Popup |
|
// Javascript Popup |
|
$('a.social-sharer').click(function() { |
|
popupSetWidth = 400; |
|
popupSetHeight = 260; |
|
// Fixes dual-screen position Most browsers Firefox |
|
dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : window.screenX; |
|
dualScreenTop = window.screenTop !== undefined ? window.screenTop : window.screenY; |
|
|
|
popupWidth = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width; |
|
popupHeight = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height; |
|
|
|
popupSystemZoom = popupWidth / window.screen.availWidth; |
|
popupLeft = (popupWidth - popupSetWidth) / 2 / popupSystemZoom + dualScreenLeft |
|
popupTop = (popupHeight - popupSetHeight) / 2 / popupSystemZoom + dualScreenTop |
|
popupNewWindow = window.open($(this).attr('href'), 'Share This', |
|
` |
|
scrollbars=yes, |
|
width=${popupSetWidth / popupSystemZoom}, |
|
height=${popupSetHeight / popupSystemZoom}, |
|
top=${popupTop}, |
|
left=${popupLeft} |
|
` |
|
) |
|
|
|
if (window.focus) popupNewWindow.focus(); |
|
return false; |
|
|
|
}); |