Twitter is among the most popular micro-blogging platform. Sharing something on Twitter is sometimes called “Tweet this” and is used to share a link to news, blog post or anything else you wanna share with your followers.
Putting a “Tweet this” button on your blog post makes it easy for your blog visitors to share your posts on twitter. Which in turn brings traffic to your blog. How much traffic it brings depends on how popular the person is and how many people follow his/her tweets. But it is always a good idea to make it easy for your blog visitors.
I searched for this kind of code I can insert in my Blogger template but couldn’t find any help. I am not exactly a web developer but know how to tweak the code to make it work. So after doing some trial and error, I can say, if you add the following code to your blogger template you can get “Tweet this” on your Blogger blog too:

<a expr:href=’”http://twitter.com/home?status=Reading ” + data:post.title + ” @YOURTwitterUSERNAME ” + data:post.url’ title=’Tweet it on Twitter’><img src=’http://LINK TO TWITTER IMAGE ON YOUR SERVER‘/></a>

A little explanation for the highlighted part of the code:

  • Replace YOURTwitterUSERNAME with your twitter user name, if you wanna track and see who is sharing your blog posts. Otherwise simply delete @YOURTwitterUSERNAME.
  • Replace the image URL http://LINK TO TWITTER IMAGE ON YOUR SERVER by the link for twitter image on your server.
  • I have added ‘Reading’ before the twitter status, if you want you can change/remove it.
  • Now add the resulting code to your blogger template. Which should be copied in the footer. Let me know if you need help in that.

The final code should look like it:

<a expr:href=’”http://twitter.com/home?status=Reading ” + data:post.title + ” @knowliz ” + data:post.url’ title=’Tweet it on Twitter’><img src=’http://lh4.ggpht.com/_4qUhcu23NoM/SHqbsDONCSI/AAAAAAAAGCE/MqYaroCiKCk/s144/itwitter.png’/></a>

Modifying the template:

  1. Go to Layouts.
  2. Expand your template under Edit HTML.
  3. Search for ‘p class=’post-footer-line post-footer-line-3′.
  4. Copy and modify the code as mentioned above in the article. (Be sure to take a backup of your template first.)
  5. Paste the modified code just after the line you searched.

Note:
Once you modify the template to include the above mentioned code.

  • ‘Tweet this’ button will appear in every post automatically.
  • You have to do it just once.
  • Even the old posts on your blog will have this button automatically.
  • When the reader click this button, it will include the URL of the post in the person’s tweet unless the readers intentionally remove it by editing the tweet.

If you have any suggestion for this post, drop in a comment. And if you like “tweet this” post and Follow knowliz on twitter.

Follow Knowliz on Twitter - Small
Update # 1: (02/13/09) – Added details about template modification.
Update # 2: (02/13/09) – Added details about changes you should see in your blog.

Suggested Posts…