Yesterday, I added the superfooter to Red Pill. And truth be told the new blog features I’m going to talk about today were actually added yesterday (after all, it would be hard to have a viewable superfooter unless something was in it), but now I’m going to describe exactly what code I used to make it happen.
In the left column of the superfooter, I wanted a tag cloud. Recent versions of WordPress have tags built in and you can use the wp_tag_cloud function to display a tag cloud on your site. My code is
<?php wp_tag_cloud(‘smallest=8&largest=22&number=20′); ?>
The attribute number=20 limits my cloud to only show the most used 20 tags in Red Pill.
In the middle column, I’m using the Recent Comments plugin to provide a list of (duh!) recent comments on Red Pill. The Recent Comments plugin is built by the same developer who built the Similar Posts plugin I wrote about on day 2 of this series. Like that plugin, Recent Comments has a ton of powerful configuration and display options that can be set from within the WordPress admin dashboard.
In the right column, I wanted to bring in the RSS feed from our Tumblelog – Blue Pill. I’m using the SimplePie RSS classes to grab the RSS feed, parse it, and display it. There’s a number of plugins utilizing SimplePie for WordPress (and tons of other content management systems out there), but I like the official SimplePie plugin that the SimplePie team maintains. I like the built in template system within the plugin that seperates the functionality from the markup and design. Once I installed the plugin and used the dashboard configuration page to define a new template called ‘tumblr’ that removed the descrition feed from the display, I added the following code to the superfooter php
echo SimplePieWP(‘http://shinynewtoy.tumblr.com/rss’, array(
‘items’ => 5,
‘cache_duration’ => 900,
‘date_format’ => ‘n/j/Y g:i A’,
‘template’ => ‘tumblr’
And with that, my superfooter was no full of some initial goodies.