newssnippetsimagesfav

Blog > Scripts > PHP Scripts > Wordpress > Display last tweets on your wordpress blog

Last articles

  • Google Plus Opens first API developer system
    Google Plus Opens first API developer system
  • Seagate GoFlex – the biggest external HDD
    Seagate GoFlex – the biggest external HDD
  • Baidu to have a new mobile OS
    Baidu to have a new mobile OS
  • How to Download YouTube Songs Onto iTunes, mp3
    How to Download YouTube Songs Onto iTunes, mp3
  • How to Download YouTube Songs
    How to Download YouTube Songs
  • Google will close 10 services
    Google will close 10 services
  • Deep Sea Wallpapers
    Deep Sea Wallpapers
  • 200 Abstract and Light Wallpapers
    200 Abstract and Light Wallpapers
  • How to test shortlinks
    How to test shortlinks
  • Huawei MediaPad – first 7 inch Android 3.2 tablet
    Huawei MediaPad – first 7 inch Android 3.2 tablet

Display last tweets on your wordpress blog

1

It is very useful to show your Twitter account on your wordpress blog by displaying your last tweets. To do this, we need to accomplish 2 steps.

First step

Open in editor function.php file and add at the end the code below:


<?php
function displayLatestTweet($twitterID){
 include_once(ABSPATH.WPINC.'/rss.php');
 $latest_tweet = fetch_rss("http://search.twitter.com/search.atom?q=from:" . $twitterID . "&rpp=1");
 echo $latest_tweet->items[0]['atom_content'];
}
?>

Second step

Open in editor the sidebar.php file and add next code:

<h2>Latest Tweet</h2>
<p><?php displayLatestTweet('twitter_account'); ?></p>

Do not forget to change the twitter_account to your Twitter account name.

Incoming search terms:

  • twitter icon

If you liked the article share it by Twitter, Facebook and Google +1.




    WordPress 3.0:Style WordPress editor using CSS
    WordPress 3.0:Style WordPress editor using CSS
    Modify the footer into the WordPress admin
    Modify the footer into the WordPress admin
    show last comments with the avatar in wordpress
    show last comments with the avatar in wordpress
    WordPress 3.0: Make your theme compatible with WordPress 3.0 menus
    WordPress 3.0: Make your theme compatible with WordPress 3.0 menus
Tags: ,

Ce ai de zis?

July 13, 2010 at 10:00 am Spune:-

you can also refer to this site on how to show the latest tweets in your blog site using tweeter API

. as easy as 1 2 3

http://www.ryscript.co.cc/web/how-to-display-latest-tweets-using-javascript-and-twitter-api/

thanks

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>