I realized the other day that I wanted blog more. At the same time I realized that I post a lot to Twitter and set out to find a way to integrate my tweets in-line with my blog posts. I also figured that as I get close to the 3200 tweet history limit it’d be nice to have some of that history in my own hands. That’s when I discovered Twitter Tools. Twitter Tools allowed me to modify my theme in such a way that I can get my tweets either as they happen, daily or a weekly summary… pretty slick. I wanted the “as they happen” option and I wanted them to show up differently, as quick blurbs (inspired by Gina Trapani’s Smarterware.org (where I think she is using QuickPost)) right in line with my blog posts. After some monkeying around, I learned I could switch the theme based on which tags were used in the post. So I set up Twitter Tools to use the tag “tweet”. With that in mind I used the following code in index.php:
<?php
$posttags = get\_the\_tags();
$tweet = false;
if ($posttags) {
foreach ($posttags as $tag) {
if ('tweets' == $tag->name) {
$tweet = true;
break;
}
}
}
if ($tweet){
include "post_tweet.php";
} else {
include "post_normal.php";
}
?>
With that in place, tweets get rendered with post_tweet.php and everything else with post_normal.php. Yeah my post_tweet.php needs some love… I’m getting there…. But in the mean time - victory is mine!