Menu Home

Getting ready for WordPress 2.3

In a few days the new version of WordPress comes out and with the exception of tags, for me the upgrade to 2.3 is pretty straight forward.

I have to plan to stop using UTW and switch to the built in tag system. I also want to make sure that I can fall back to 2.2.3 if the “bad thing” happens.

I like to mix tags with Share This on the same line, seperated by a “|”. On my blog I currently have the following lines in my theme:

  1. <div class=”utwtags”>
  2. <?php if (function_exists(‘akst_share_link’)) : ?> <?php akst_share_link(); ?><?php endif; ?>
  3. <?php if (function_exists(‘akst_share_link’) and function_exists(‘UTW_ShowTagsForCurrentPost’)) : ?> <?php _e(‘ | ‘); ?> <?php endif; ?>
  4. <?php if (function_exists(‘UTW_ShowTagsForCurrentPost’)) : ?><?php _e(‘Tags: ‘); ?><?php UTW_ShowTagsForCurrentPost(“commalist”) ?><?php endif; ?>
  5. </div><p />

I am the king of Ugly Code(tm). Someday I will re-write the theme to make it readable and organized. I repeat the same code in 4 different files.

In WordPress 2.3 the_tags() function is available. I want to be able to roll back to UTW and 2.2.3 so I add some if..thens to check for the_tags(). I will have UTW disabled with 2.3 and the inserted code is in bold below on lines 3 and 5.

  1. <div class=”utwtags”>
  2. <?php if (function_exists(‘akst_share_link’)) : ?> <?php akst_share_link(); ?><?php endif; ?>
  3. <?php if (function_exists(‘akst_share_link’) and (function_exists(‘UTW_ShowTagsForCurrentPost’) or function_exists(‘the_tags’))) : ?> <?php _e(‘ | ‘); ?> <?php endif; ?>
  4. <?php if (function_exists(‘UTW_ShowTagsForCurrentPost’)) : ?><?php _e(‘Tags: ‘); ?><?php UTW_ShowTagsForCurrentPost(“commalist”) ?><?php endif; ?>
  5. <?php if (function_exists(‘the_tags’)) : ?><?php the_tags(); ?><?php endif; ?>
  6. </div><p />

For my archive template I have a tag cloud using this code.

  1. <?php if (function_exists(‘UTW_ShowWeightedTagSet’)) { ?>
  2. <p>Tags:</p>
  3. <div class=”utwtag-cloud”>
  4. <?php UTW_ShowWeightedTagSetAlphabetical(“coloredsizedtagcloudwithcount”,””,0); ?></p>
  5. </div>
  6. <?php } ?>

The </p> at the end of line 4 is because the UTW function leaves out the closing </p> and messes up validation (I have no idea why). This code is fine and can stay. I just insert code underneath just like it as so

  1. <?php if (function_exists(‘wp_tag_cloud’)) { ?>
  2. <p>Tags:</p>
  3. <div class=”tag-cloud”>
  4. <?php wp_tag_cloud(‘number=300’); ?>
  5. </div>
  6. <?php } ?>

The default number of tags is 45. That shows the 45 most used tags; I just put 300 (way more than I use) to keep it on par with the existing tag cloud and display all the tags I have.

The UTW importer in 2.3 is pretty good but it adds a hyphen where a space should be. So “Far Cry” becomes “Far-Cry”. This is in the tag label and originally I was going to play with the dump of my database, modify tags by hand and hope for the best. WordPress 2.3 has no built in tag management system.

Rather than start that brain surgery I lucked out. Poplarware provides the Advanced Tag Entry plugin which lets you modify and manage your WordPress tags from the write post page on your blog. My only minor complaint is that the plugin does not also live under the Manage section. Using this plugin let me edit and fix the space issue on my tags. Going forward I’ll use this plugin to select the tags I want to re-use.

Christine (the UTW author) put together a good plugin for using Yahoo’s API to obtain tag suggestions. It’s called Tag Suggest Thing and it uses Yahoo to get suggested tags for your post. You can click on the tags one at a time or add all. Very useful.

With the exception of one plugin (which I don’t really use) all my plugins work with 2.3-RC1. This is all tested on my backup blog and with these changes and getting two new plugins, I should be ready for 2.3 without any hitch.

Categories: Geek Software

Tagged as:

Jan Dembowski