Display Twitter tweets on your blog without a plugin

by Mayur on May 23, 2009

in Blogging

Follow us on twitter Most of bloggers nowadays use Twitter as their social network. If you’re running a blog, you must share your tweets with your blog readers too.

You can simply show your latest tweets on your blog using some plugins or manually. I suggest you to do it manually as it’s not that difficult as you thought.

You’ll require to add only 3 lines of code to your theme to display the Tweets.

1) There are 2 bits of javascript that you’ll need to place anywhere on the page. I’ll suggest to put the below code at the bottom of page, before </body> tag in footer.php

<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/Username.json?callback=twitterCallback2&count=1"></script>

Remember to replace the word “Username” with your twitter username. Also change count=1 with the number of tweets you want to display.

2) To display the Tweets, just add the below code in sidebar.php or create a widget for it. Use PHP Code widget plugin to insert the HTML code to your widgets.

<div id="twitter_div"><ul id="twitter_update_list"><li>&nbsp;</li></ul></div>

That’s it. Now your visitors will see your latest tweets. This will help in increasing your twitter followers too. Your tweets will look like as shown in below image:

Display tweets on your blog without plugin

Follow Us on Twitter Now !

Bookmark   Digg | Delicious | Stumble | Technorati | Facebook | Reddit | Tweet This |

Related Posts:

Liked this article? Then SUBSCRIBE to RSS Feed or get Free updates via E-MAIL



{ 1 comment… read it below or add one }

Gagan May 24, 2009 at 2:33 pm

interesting, and we should avoid installing plugins for all these small tasks, rather we should use direct method.

Reply

Leave a Comment

Previous post:

Next post:



   Copyright © 2008-2010 WebTrickz | Sitemap | Privacy Policy | Advertise