Ultimate tag warrior is not something to be undertaken lightly. There are passages that are twisty, and all alike. There may even be pong. I'm pretty sure there are no sideways scrolling platform games. Actually, I don't know that there is pong or twisty passages either. The point is, ultimate tag warrior has a higher than average barrier to entry: you need to be using Wordpress 1.5(+), you need to be okay with modifying templates, there's some URL rewriting, not to mention database changes (There's a little guy to do that last one for you. All you have to do is ask him. P.S. This is what happens in step four of the installation. More on that, after step three of the installation.).
This document is getting long and scary. This is an overview that tells you the basics of what you need to know if you've already got a pretty good handle on how to cram plugin functions into your wordpress install.
To install, run the ultimate-tag-warrior-install.php. This creates a table for tags and a table that maps tags to posts. You only need to run this once - none of the upgrades change the database schema. There's also a default tag.php template file for the default theme to be wrangled as you see fit.
To use, there are four functions of interest:
As far as wrangling your tags; if you go to the Manage menu in the administration side of wordpress, there is a Tags menu which allows doing some basic administration of tags. You can rename tags, and delete tags at this stage.
To view tagged postings, go to /tag/{tagname} or /tags/{tagname} for a single tag; or, you can use del.icio.us-esque syntax, and go to /tag(s)/{tag1}+{tag2}+...+{tagn} to get the intersection of a set of tags.
From 0.1 to 0.2
From 0.2 to 1.0
From 1.0 to 1.1
There are six steps to enlightenment through ultimate tag warrior.
That's all that needs to happen for tagging to start happening. To be able to see the tags, you'll need to make changes to your templates. Luckilly, the next section tells you what you need to know!
It turns out that ultimate tag warrior is like a three plugins rolled into one.
In the index.php template, include a call to ultimate_show_post_tags
This is the minimum that I'd do. However, if you are mighty, you might want to consider one (or both) of these next two ways to make your blog more taggy.
The most typical place to put this would be in the sidebar. To display the most popular tags, include something like this in your sidebar:
The third facet of tag display is the tag archive. This sorta fits in the archives.php template (moreso if you're also using the category archive. There's a calendar version on the way, I promise!). You'll want to include something along the lines of this:
If the theme you use is significantly different from the default template, then you're going to need to create a tag.php in your theme. There are two ways to approach this (there could be others, but, well, you know.):
1. Start with the default tag.php file, and wrangle it to match the rest of the theme.
2. Start with a copy of index.php, and poke in the bits needed to display items matching a tag.
Which ever way you choose, there are three bits of code that need to be in the final template.
To include a list of related tags, make a call to the ultimate_show_related_tags function. With no parameters, the function returns tags wrapped in <li> tags.
Perhaps you would like a tag cloud. There are two parts to this: updating a theme to include a call to the tag cloud function, and adding CSS to style the tag cloud.
For a tag cloud ordered alphabetically, include
For a tag cloud ordered by tag popularity (most to least)
For the CSS; you'll need to add some things to the style.css file. What I've included in this example will vary the presentation using the size only. By all means use colours or any other means you'd like to differentiate tag popularity.
In order to administer tags, you need to be higher than level 3. Hokay! Click on the "Manage" link in the wordpress admin system; then click on the "Tags" submenu. This will display a list of all of the tags. Beside each tag, there are two links.
Rename tag, takes you to a page which allows changing the display of a tag. Type the new name in the text box, hit "Save", and then your tag will be renamed. If there's already a tag with that name, the display of the tag widgets looks okay (there are no duplicates); but the counts for the tags might be a little bit off if posts have been tagged with both versions. Some kind of merge thing is on my todo list; but you know what they say about building Rome.
Delete tag, takes you to a confirmation page. If you click yes; then the tag (and the associations to posts) will be deleted. This isn't something you can undo, so be careful (:
The plugin creates redirects that simplify the urls that tags use. If you had the tags pony and circus, these are the ways you could access the tag pages:
This function displays a list of the tags associated with the current post (that is, the one defined by the global variable $post). Each tag is displayed as a link to the tag page specified by the base url, along with » characters for any links specified in $morelinks.
I opted for using a seperator, rather than a prefix and postfix for the list items; so if you wanted to wrap the tags in <li> tags, you'd need to use </li><li> as the seperator, and wrap the whole list in a pair of <li> tags (not to mention the list tags).
Useful urls for $morelinks are http://www.technorati.com/tags/ http://del.icio.us/tags/ and http://www.flickr.com/photos/tags/
This function creates a list of the most popular tags, with the number of occurances. The opening and closing list tags aren't included, to allow choosing between ordered or unordered lists in the enclosing template.
The format of the tags that are output is:
Perhaps you are familiar with the category archive plugin I wrote. This function creates a tag archive in the same format; but using tags instead of categories.
This function returns the top tags (the maximum is specified by $limit), and the most recent posts (the maximum number of posts to display is specified by $postlimit). If there are more posts, then a link to the tag page is also displayed.
This function displays a list of tags, in the specified order. The tags are displayed using a CSS class depending on the tag popularity; and the tags link to their tag page.
The popularity algorithm is kinda hinky. The popularity of a tag depends on how many posts it appears on compared to the average.
"taglevel1" is the largest, and has the tags which are used more than 20x the average; and "taglevel7" is the smallest, and has all of the tags which are used less than average. The rest of the tag levels cut off at 10x the average, 6x the average, 4x the average, 2x the average, and 1x than the average.
This function displays a list of tags that are related to the current tag set (if you are looking at /tag/monkey then the current tag set is monkey. /tag/monkey+banana has monkey and banana as its current tag set). Each of the tags is wrapped in the prefix and postfix specified; and for each tag, there is a + link, that adds the tag to the tag set, a link to the tag, and an indication of the number of times the tag is used.
Related tags are all of the tags, from all of the posts that match the current tag set; excluding the ones which are already part of the current tag set.
If you place this function pretty much anywhere but tag.php, nothing is going to happen.
The rest of the functions do the behind the scenes donkey-work; and as such aren't too interesting in the day-to-day running of ultimate tag warrior.
The code for selecting tagged posts from the database. It looks in the tag get variable; and when more than one tag is specified, the posts which match all of the tags are retrieved.
Writes the tags for the current post to the database.
The code for displaying the tag entry box on the post editing page.
The code for displaying the tag pages, and the tag archive page.
The code for redirecting requests to /tag/ and /tags/.
The code that performs the administration magic.
The code that hooks the administration up to the manage menu.
I have a todo list. Some of these things are more likely than others to get done.