Upgrading to WordPress 2.3 – The Tag Issue

With WordPress 2.3 expected out on September 24th, I’ve been giving the beta releases a whirl to see how what I need to do before I make the final change over.

I currently have 17 plugins(!) installed but I’m most concerned about Ultimate Tag Warrior – will it work in WP2.3?

Short Answer: Not really.

UTW doesn’t play well with WP2.3. Tags show up on posts but there’s a “No Posts Found” error on the link to see other posts with the same tag.

Since I’m only using a small portion of UTW’s capabilities: tagging posts, displaying those tags in my posts and a tag index, I ended up using the UTW importer.

The UTW Importer

Tagging problems in WordPress 2.3While all the post relationships and tags are passed over, tags with more than two words are hyphenated. Yikes! It seems that the importer considers tag names and tag slugs to be the same thing. Hopefully, that will be fixed soon.

Formatting Tags

With WordPress 2.3, there’s a number of tag-related template tags you can use: the_tags(), wp_tag_cloud. Rich Gilchrest has a helpful guide for updating your theme.

But wait, aren’t tags generally lowercase? Yes they are but as you can see in the screenshot above, there are some tags like “post avatar” and “wordpress” that appear as “Post Avatar” and “WordPress”.
This happens when a term, in this case “Post Avatar”, is shared by both a tag and a category. To get around this issue, you can define a css class to use in your templates and set text-transform to lowercase.

.post_tags { text-transform: lowercase}


So, inside index.php, archive.php and single.php I changed the format of the_tags to:

<?php the_tags('Tags: <span class="post_tags"', ', ', '</span><br />'); ?>

For wp_tag_cloud(), your styling options will depend on the cloud format that you choose.

By default, tag cloud formats to “flat”, generating a space separated list of your tags. So your template could look something like this:

<p class="post_tags"><?php wp_tag_cloud(); ?></p>

If you format it to “list”, you will get an unordered list (ul) with the class “wp-tag-cloud”.

Update your css file to reflect this new class:
.post_tags, .wp-tag-cloud { text-transform: lowercase }

The Tag Index

Creating an index of all your tags is quite simple.
First, create a new template (I called mine “Tag Index”) which contains the wp_tag_cloud with the following parameters:

<?php wp_tag_cloud('format=list&smallest=12&largest=12'); ?>

  1. format: I set this to “list” to create an unordered list
  2. smallest and largest: I made the font sizes equal so there would be no trace of the cloud effect. In this case the font size is 12pt

Using the Default Theme as an example, this is what your final template will look like…

<?php
/*
Template Name: Tag Index
*/
?>
<?php get_header(); ?>
<div id="content" class="widecolumn">
<h2>Tags</h2>
<?php wp_tag_cloud('smallest=12&largest=12');?>
</div>
<?php get_footer(); ?>

Now upload your template and once you’ve done that, create a new Page and assign the “Tag Index” template to it.

Also make sure that the Page Slug is “tag”. If you’re using pretty permalinks you can access your tag index from http://yourdomain.com/tag/.

Whew! One plugin down, 16 more to go!

Post Avatar Compatible with WordPress 2.3

I’ve installed the beta version of WordPress 2.3 and Post Avatar is running smoothly. Wheeee

There will be an update of the plugin due in a couple of weeks. Here’s a feature list:

  • Post avatar role – this will be useful for a community blog that wants to limit posting avatar rights to editors and admins only. If you’re using Role Manager 2.0, you can customize access rights.
  • Customizable HTML/CSS options for automatic display – if you’re not using the template tag, you will be able to specify your own HTML styling or CSS class to match your theme instead of editing the stylesheet that comes with post avatar.
  • Display in excerpt – Avatars currently show up wherever the the_content() tag is. I’ll be adding the display for the_excerpt() as well.

Update: Corinne helpfully pointed out a bug which causes the avatar to show in feeds. I’ve made the necessary fixes and updated the download file

Bon Voyage

The gang got together for an afternoon out before Jake headed off to Camiguin Island to practice medicine. We watched Blades of Glory (much better than I anticipated) and had dinner.

Unfortunately Jake couldn’t join us for dinner – he still had to pack. I got a text message from him yesterday that his baggage was 20 kilos over the limit.

Well Jake, enjoy your experience in Camiguin. We’ll be looking forward to your missives on your new island adventures