How To Automatically add Twitter and Facebook buttons to your posts, this trick original created by Dev7Studios and I will share it again for you.
Like on many many WP Tutorials that I was write on WP Tricks, you need to put this code on functions.php on your current theme
function share_please($content){
if(!is_feed() && !is_home()) {
$content .= '<div class="share-this">
<a href="http://twitter.com/share"
class="twitter-share-button"
data-count="horizontal">Tweet</a>
<script type="text/javascript"
src="http://platform.twitter.com/widgets.js"></script>
<div class="facebook-share-button">
<iframe
src="http://www.facebook.com/plugins/like.php?href='.
urlencode(get_permalink($post->ID))
.'&layout=button_count&show_faces=false&width=200&action=like&colorscheme=light&height=21"
scrolling="no" frameborder="0" style="border:none;
overflow:hidden; width:200px; height:21px;"
allowTransparency="true"></iframe>
</div>
</div>';
}
return $content;
}
add_action('the_content', 'share_please');
Using This method is the most easiest and simple way to promote our post into Facebook and Twitter.
Now with this tricks we can easily add Twitter and Facebook buttons to the bottom of your posts. And the code will be put automatically.
Photos source http://www.flickr.com/photos/wyrdo/3753428652/




Pingback: Tweets that mention How To Automatically add Twitter and Facebook buttons to your posts # WordPress Tricks & Tips -- Topsy.com