I haven’t implemented this here on the blog, however I am definitely considering doing so. Do you want to make sharing of your blog articles on Twitter easier than ever?
The easiest option is to add a Twitter button on each post. The following code does just that, and the button will only appear on a single post, and not blog, archive, or search pages.
add_action( 'the_content' , 'itsb_tweet_button' );function itsb_tweet_button( $content ) { if ( is_single() ) return '<div class="twitter-button"><a href="http://twitter.com/share" class="twitter-share-button" data-url="'. get_permalink() .'" data-count="vertical" data-via="oursexsecrets">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>' . $content; return $content;}The code adds a div before the main content that you can style as you want. You can float it to the left or the right, and position as you want.
You can also customise the output of the function, and move the twitter button to the end of the content. Or add other social media buttons as well, tweaking the output and position the way you like it.




