After getting several e-mails and comments from readers asking how I did this or made that work with the Vertigo theme for WordPress, I’ve decided to share the modifications.
This ZIP file contains six files — modified versions of functions.php, index.php, and comments.php for the Vertigo 3-Column theme, index.php for Vertigo 2-Column, and a Tag Cloud page template for both 2 and 3-column versions.
Two caveats. First, these files do use WordPress 2.3 template tags, as they call the tagging functions. Second, the index.php file calls a Related Posts plugin, specifically Yet Another Related Posts Plugin.
Let’s start with comments.php.
What I did with comments.php was to separate out the comments and trackbacks/pingbacks. Comments go at the top, trackbacks and pingbacks go below.
The file does not contain gravatar support. Gravatar support in Vertigo is possible — I use them myself — but it’s going to take a little more time to explain how to get them to work, and I’ll leave that for another time.
Index.php (which if you use on the 2-column, you need to rename index-2col.php to index.php) replaces the left sidebar with navigational information like previous post links, next post links, a tag list, and related tags.
This isn’t a criticism of the Vertigo design by any means, but single post pages aren’t conducive to helping readers figure out where to go next. That’s the flexibility of the theme — if I want to treat my single post pages as a landing page, I can make the changes needed to help people find similar content on my blog that will interest them. So I replaced the sidebar with navigational and meta details. That’s the one I’ve received the most questions on.
Tags.php (or Tags-2col.php) is a page template for a WordPress 2.3+ Tag Cloud. Create a page in WordPress, and use Tags as your page template, and you’ll get a tag cloud like this one.
The functions.php file is a pretty powerful tool in a WordPress theme if used; you can use it to store theme-specific plug-ins or additional code. The file does three things.
- Create a tag list that formats well in the sidebar.
- Create a calendar that works with widget formatting.
- Eliminate self-pings on trackbacks. (In other words, if I write a post, and link back to a previous post in my blog, that previous post won’t get a trackback from my new post. I find that can be really cluttersome.)
Assuming you’ve made no changes of your own to the functions.php file that came with Vertigo, you should be able to upload this to your template directory and be good to go. It will give you two new widgets:
- Vertigo Calendar
- Vertigo Tags
To get both to work right with Vertigo, some changes need to be made to your style.css file.
For the calendar, this is the code I use:
#vertigo-calendar table { width: 100%; }
#vertigo-calendar th { width: 14%; }
#vertigo-calendar td { text-align: center; }
For the tags, I found the lines in style.css that read like this:
#categories-1 ul {
and added another definition, like this:
#categories-1 ul, #vertigo-tags ul {
So, wherever there’s a #categories-1 of something, I added a #vertigo-tags of the same thing.
#vertigo-tags { text-transform: capitalize; }
That will make your tags Sentence Case, with the first letter of each word capitalized. Personally, I think it makes them look sharper, more professional.
You also get a new template tag, if you want to use it:
It takes all the same arguments as WordPress’ built-in tag_cloud function, but it adds one thing. You can set the “unit” parameter to “none” and then the tag cloud won’t generate any of the hard-coded sizing that WordPress’ tag cloud function does. It still takes all the other parameters, so if you want flat instead of list, you can do that.
Also, if your smallest and largest font sizes are set exactly the same, vertigo_tag_cloud won’t attempt to calculate the font size like WordPress’ function does. There’s a division by zero in the WordPress function, which can lead to some strange font renders if the sizes are the same.
The code in both tag and calendar functions is the code out of the WordPress core, but with some modifications. The calendar widget puts the widget theme hooks in more logical places (like turning the month into a header, thus eliminating the usual double header that happens with the WordPress calendar). The tag function was tweaked because I didn’t like the hard-coding of font sizes.
There. My second gift to the WordPress community, after Shire Reckoning. 🙂