Created
August 1, 2012 15:33
-
-
Save ebinnion/3227891 to your computer and use it in GitHub Desktop.
Social Sharing Buttons Thesis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#sharebar { | |
background: #fff; | |
padding: 0; | |
list-style: none; | |
margin: 0; | |
width: 100%; | |
overflow: auto; | |
} | |
#sharebar ul { | |
margin: 0 0px; | |
list-style: none; | |
} | |
#sharebar li { | |
display: block; | |
margin-right: 10px; | |
padding: 0; | |
overflow: visible; | |
text-align: center; | |
float: left; | |
} | |
#sharebar #fb { | |
margin-left: 10px; | |
text-align: left; | |
} | |
p.recommended { | |
background: whiteSmoke; | |
padding: 14px; | |
border: 2px solid #EFEFEF; | |
text-align: center; | |
} | |
.page { | |
position: relative; | |
} | |
#sharebar #fb { | |
width: 45px; | |
margin-left: 0px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add_floating_share(){ | |
global $post; | |
if(is_single() || is_page()){ | |
?> | |
<div id="sharebar"> | |
<ul> | |
<li><a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="taxreceipts">Tweet</a></li> | |
<li><g:plusone size="tall"></g:plusone></li> | |
<li id="fb"><div id="fb-root"></div><fb:like href="" send="false" layout="box_count" width="65" show_faces="true" font="tahoma"></fb:like></li> | |
<li><su:badge layout="5"></su:badge></li> | |
<? | |
$img_url = get_post_meta($post->ID, 'img_url', true); | |
$anchor_text = get_post_meta($post->ID, 'anchor_text', true); | |
$pin_description = get_post_meta($post->ID, 'pin_description', true); | |
if(strlen($img_url)>0 && strlen($anchor_text)>0 && strlen($pin_description)){ ?> | |
<li><a href="http://pinterest.com/pin/create/button/?url=<?=get_permalink();?>&media=<?=$img_url;?>&description=<?= $pin_description;?>" class="pin-it-button" count-layout="vertical"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a></a></li> | |
<? } ?> | |
</ul> | |
</div> | |
<? | |
} | |
} | |
add_action('thesis_hook_before_post','add_floating_share'); | |
function social_footer(){ ?> | |
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> | |
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> | |
<script src="http://connect.facebook.net/en_US/all.js#appId=176133919079931&xfbml=1"></script> | |
<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script> | |
<div id="fb-root"></div> | |
<script>(function(d, s, id) { | |
var js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) return; | |
js = d.createElement(s); js.id = id; | |
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=120406481416771"; | |
fjs.parentNode.insertBefore(js, fjs); | |
}(document, 'script', 'facebook-jssdk'));</script> | |
<script type="text/javascript"> | |
(function() { | |
var li = document.createElement('script'); li.type = 'text/javascript'; li.async = true; | |
li.src = window.location.protocol + '//platform.stumbleupon.com/1/widgets.js'; | |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(li, s); | |
})(); | |
</script> | |
<? | |
} | |
add_action('wp_footer','social_footer'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment