Skip to content

Instantly share code, notes, and snippets.

@justinwhall
Created March 20, 2012 19:07
Show Gist options
  • Save justinwhall/2139927 to your computer and use it in GitHub Desktop.
Save justinwhall/2139927 to your computer and use it in GitHub Desktop.
PHP: WordPress | Social_Share_it
//social share
function social_share_it(){
//get the user entered URLS/usernames from WP backend
$twitter = mytheme_option('twitter');
$facebook = mytheme_option('facebook');
$googleplus = mytheme_option('googleplus');
?>
<?php //print he icons ?>
<ul id="social-share">
<li class="connect-twitter">
<a href="<?php echo $twitter; ?>">Twitter</a>
</li>
<li class="connect-facebook">
<a href="<?php echo $facebook ?>">Facebook</a>
</li>
<li class="connect-googleplus">
<a href="<?php echo $googleplus ?>">Googleplus</a>
</li>
<li class="connect">
<p>Connect with us:</p>
</li>
</ul>
<?php
}
//CSS
/*=========== social =====================*/
#social-share{
float: right;
margin-top: 70px;
width:40%;
}
#social-share li{
float: right;
margin-left:6px;
}
#social-share li a{
display: block;
text-indent: -9999px;
width:23px;
height:24px;
}
#social-share li.connect-facebook{background:url(images/ico_facebook.png) top left no-repeat;}
#social-share li.connect-twitter{background:url(images/ico_twitter.png) top left no-repeat;}
#social-share li.connect-googleplus{background:url(images/ico_gplus.png) top left no-repeat;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment