Tips and Tricks

August 13, 2010

How to get Twitter’s Official Tweet Button for Thesis WordPress Theme?


Twitter has launched its own Tweet Button service for end users as well as website and blog owners. To add this button, you just have to copy-paste the code given by Twitter team on their website.

If you are using simple WordPress theme, you can use following code to get the Tweet Button for your blog.

Get Tweet Button for Simple WordPress Theme

Code for Simple WordPress theme users:

<a href=”http://twitter.com/share” class=”twitter-share-button” data-count=”horizontal” data-via=”Harsh4d”>Tweet</a>

<script type=”text/javascript” src=”http://platform.twitter.com/widgets.js”></script>

Get Tweet Button for Thesis WordPress Theme

I’m sure many of you are looking for a simple Tweet Button code for your Thesis Theme blogs.

Go to the following URL and copy-paste the given code.

/public_html/wp-content/themes/thesis_17/custom/custom_functions.php

Code for Thesis Theme Users:

function custom_byline() {

?>

<div style=”float:right; margin-top:-17px;margin-right:-10px;”>

<a href=”http://twitter.com/share” class=”twitter-share-button”
data-url=”<?php the_permalink() ?>”
data-via=”Harsh4d”
data-text=”<?php the_title(); ?>”
data-count=”horizontal”>Tweet</a>

<script type=”text/javascript” src=”http://platform.twitter.com/widgets.js”></script>
</div>

<?

}

add_action(‘thesis_hook_byline_item’,'custom_byline’);

Note: The above code will help you add Tweet Button in Thesis Theme byline. If you want to place it somewhere else, just change the Thesis hook. You can add more properties to your Tweet Button; see here.

Also, remove the data-via = “Harsh4d” and replace it with your Twitter handle.

Also see – Get TweetMeme Button on Thesis WordPress Theme







3 Comments


  1. I have been trying to get my facebook and tweet button to look exactly like yours (on my thesis theme) but I don’t understand how you did it. Can you please explain it once more and with more details?


  2. Will you please drop me an e-mail here? – support [at] tech-exclusive [dot] com


  3. Hi,
    Yes, would you explain in more details how to place tweet and FB buttons exactly like yours in thesis?
    Thank you



Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>