Posted: February 3rd, 2009 | Author: Barrie Adams | Filed under: Wordpress Hacks | Tags: code snippet, wordpress, wordpress code, Wordpress Hacks, wordpress how to | No Comments »
Display the most recent 5 posts in Wordpress.
To change from 5 posts to however many you like, change the first line of code to reflect.
###articles###
Posted: February 3rd, 2009 | Author: Barrie Adams | Filed under: Wordpress Hacks | Tags: code snippet, wordpress, wordpress code, Wordpress Hacks, wordpress how to | No Comments »
This allows you to theme/style and control the currently selected menu tab in CSS by adding a class=”current” on it.
If Home, or Category, or Archive, or Search or Single page is selected, class=”current” will be included in
If category with category slug of css or showcase, class=”current” is added.
Posted: February 3rd, 2009 | Author: Barrie Adams | Filed under: Wordpress Hacks | Tags: code snippet, wordpress, wordpress code, Wordpress Hacks, wordpress how to | No Comments »

// Your twitter username.
$username = "TwitterUsername";
// Prefix - some text you want displayed before your latest tweet.
// (HTML is OK, but be sure to escape quotes with backslashes: for example href="link.html")
$prefix = "";
// Suffix - some text you want display after your latest tweet. (Same rules as the prefix.)
$suffix = "";
$feed = "http://search.twitter.com/search.atom?q=from:" . $username . "&rpp=1";
function parse_feed($feed) {
$stepOne = explode("", $feed);
$stepTwo = explode("", $stepOne[1]);
$tweet = $stepTwo[0];
$tweet = str_replace(”<”, “<”, $tweet);
$tweet = str_replace(”>”, “>”, $tweet);
return $tweet;
}
$twitterFeed = file_get_contents($feed);
echo stripslashes($prefix) . parse_feed($twitterFeed) . stripslashes($suffix);
?>