How to Add Official Tweet Count button to Thesis Theme

by Nandupatel on August 14, 2010

In my previous post, I mentioned that Thesis 1.8 is coming soon and if you bought thesis wordpress theme then this tutorial might help you to customize thesis theme. Twitter officially launched Tweet count button and you might want to add it in your thesis wordpress theme.

How does it look on my thesis theme?

Go to Twitter’s official Tweet count page. you can choose one out of three different style of tweet button.

Select button you want, and Keep the page open for later to get code.

Step1:

Go to your admin page and Select Custom file Editors. Choose Custom_function.php and Copy following code in it.

function twitter_offical_tweet_btn() {
if (is_single()){ ?>
<a href="http://twitter.com/share" data-count="vertical" data-via="thetricks">Tweet</a>
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<?php }
}
add_action('thesis_hook_before_post', 'twitter_offical_tweet_btn');

Step2:

Open Twitter’s Official Tweet button and Copy code at the end of page. Change red code here with your code. Click Save and you are done!

Above code will show twitter button only on single page. If you want to show it on main page too, just use below code.

function twitter_offical_tweet_btn() {
?>
<a href="http://twitter.com/share" data-count="vertical" data-via="thetricks">Tweet</a>
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<?php
}
add_action('thesis_hook_before_post', 'twitter_offical_tweet_btn');

If you didn’t buy thesis yet, it is not too late before price goes up. Buy thesis theme now..!

Leave a Comment

Previous post:

Next post: