How can I show my latest tweet in my wordpress blog?

function get_twitter_feed(){

$userID = 'ImOttoman';  //your twiter username

$url="http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=$userID&count=1";

$xml = simplexml_load_file($url) or die("could not connect");

       foreach($xml->status as $status){
       $text = $status->text;
       }
       echo $text;
}
add_filter('wp_head','get_twitter_feed');

You never said where you want it so this just pops it into the head (not a great idea), and is a bad example lol.

Instead you should use the HTTP API and cache the results for at least 10 minutes.

Also you should just use a plugin for more features because there is NO difference between a plugin and functions.php.


Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)