I decided to use the built in Facebook sharer and Twitter sharer links, as provided on each site. It won’t give complete functionality, but it it’s perfect for a simple custom icon.
Note: This will only work properly within ‘the loop’
HTML code to be inserted in your page template:
<div class="social_icons">
<a href="https://wordpress.stackexchange.com/questions/125838/javascript:window.print()" target="_blank" class="printIcon">
Print page
</a>
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo get_permalink(); ?>" target="_blank" class="facebookIcon">
Share on Facebook
</a>
<a href="https://twitter.com/share?text=<?php echo get_the_title(); ?>+–+" target="_blank" class="twitterIcon">
Tweet on Twitter
</a>
</div>
Basic CSS styling:
.social_icons {
float: right; /*change for your specific needs*/
}
.social_icons a {
text-indent: -9999px;
height: 50px; /*change for your specific needs*/
display: block;
float: right; /*change for your specific needs*/
}
.social_icons a.printIcon {
background-image: url(); /*add a custom share icon*/
background-repeat: no-repeat;
}
.social_icons a.facebookIcon {
background-image: url(); /*add a custom share icon*/
background-repeat: no-repeat;
}
.social_icons a.twitterIcon {
background-image: url(); /*add a custom share icon*/
background-repeat: no-repeat;
}