Site icon WP Smith

How to Add a Twitter Share Button to Your Post Info in Genesis

Simply add the following code to your functions.php file.

[php]// Modify Post Info
add_filter('genesis_post_info', 'my_post_info_filter');
function my_post_info_filter($post_info) {
if (!is_page()) {
$post_info = '[ post_date] By [ post_author_posts_link] [ post_comments] | Share: <a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="TWITTER_USERNAME">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> '; //remove spaces after initial [
//$post_info = 'Custom text'; //edit this to whatever you'd like.
}
return $post_info;
}[/php]