Here’s a quickie small tip for wordpress blog users.
If you want to add your own facebook, twitter and Google +1 buttons to your blog post, simply add the following code to your functions.php of your current theme:
<?php
add_filter ('the_content', 'insertMeShare');
function insertMeShare($content)
{
if(is_single())
{
global $post;
$link = urlencode($post->guid);
$content.= '<a href="http://twitter.com/share" data-count="horizontal">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>';
$content.= '<iframe src="http://www.facebook.com/plugins/like.php?app_id=181276555267890&href='.$link.'&send=false&layout=button_count&width=110&show_faces=false&action=like&colorscheme=light&font&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:21px; float: relative; " allowTransparency="true"></iframe>';
$content.= '<g:plusone></g:plusone><script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>';
}
return $content;
}
?>
This code above can be modified further as a wordpress plugin so as to not modify your current theme (especially if your theme is one of those ready made themes which has an update feature). I have made mine to be a wordpress plugin and I am using this now as my current social share buttons – see the end of my post as an example of these in action. Have fun!
Nice Posting in your Blog. If you want get more information please check my Site. Thank you
Pingback: Figure out how to work Search engine optimization Wordpress Plugin