Tag Archives: tags

wp_tag_cloud() – WordPress 2.3

Small Potato covered one of the new tag functions that will be appearing in WordPress 2.3 – <?php the_tags(); ?>. I was pleased to find, though, that the WordPress development team had included the new tag cloud function, as well, since I currently use UTW’s tag cloud as an enhanced site index.

The documentation on <?php wp_tag_cloud(); ?> is currently incomplete, so I had to do some digging into the core code to find out how to adjust the parameters. <?php wp_tag_cloud(); ?> takes a string of parameters that adjust how your tag cloud displays. For example, <?php wp_tag_cloud('number=20&order=desc'); ?> will display a tag cloud of your top 20 tags and sort them in descending order.

Here are the various settings:

* smallest – Adjusts the size of the smallest tags in the cloud. Default is ‘8’.
* largest – Adjusts the size of the biggest tags in the cloud. Default is ’22’.
* unit – Sets the unit type for font size (i.e. point or em). Default is ‘pt’.
* number – How many tags will display in the cloud. Default is ’45’.
* format – ‘Flat’ displays an inline cloud with each term separated by whitespace. ‘List’ generates an unordered list. ‘Array’ lets you define an array of tags. Default is ‘flat’.
* orderby – Sort the cloud by ‘name’ or ‘count’. Default is ‘name’.
* order – Sort the cloud in ascending or descending order. Default is ‘ASC’.

The new native taxonomy isn’t as powerful as UTW was, but I’m sure it won’t be too long before there will be a host of new plugins to change that.

WordPress 2.3 Beta 2 releases on Monday. I’ll write about any new changes somewhere around then.

Tagging Fears in WP 2.3

Tags are coming to WordPress soon as part of the core. This, to me, is both a good thing and a potential complication. It’s good because suddenly WP users won’t have to rely on plugins to tag their entries. The potential complication that could make things a bit more… sticky is whether or not the native WP tagging system will accommodate an import of tags from other plugins. For instance, I’ve been using Ultimate Tag Warrior to tag my entries and make a pseudo-site index from the resultant tag cloud. I spent a number of hours cataloguing my entire blog with UTW and the _last_ thing I want to do is have to repeat the process with the native tag system in WP. And believe me, I’ll likely prefer the WP tag system exactly _because_ it’s native. My philosophy has always been that the more you can do natively, the better, easier, and more efficient things will be because there will be less likelihood of coding conflicts to break functionality. I’m really, truly hoping that WP will allow for some sort of tagging import for the most popular tag plugins because otherwise things are likely to become a bit of a headache again for a while as I transfer things over and manually go through and tag every single entry again. We’ll just have to wait and see how the WP developers handle this new feature. I’m always excited by new toys being added to the core WP files, but there’s always a bit of trepidation to go along with it, since there’s always the risk that many of my favorite plugins will break. I’ve already lost one with the upgrade to 2.1.3; I hate to lose too many more.

Tag Filters

I’ve a feature request for all you php ninjas out there, particularly those of you who develop plugins that do strange and wonderful things with tagging:

How about making the ability to tag posts in WordPress a little bit more powerful? For instance, I use “Ultimate Tag Warrior”:http://www.neato.co.nz/ultimate-tag-warrior/ to create a site index here, and it’s nice to be able to click on a particular tag and see all of the entries that fall under it.

Here’s the thing, though – I’d like to see it be possible to filter down still further into those entries. Instead of, for instance, being able to see the entries that fall under speculative fiction only, I’d like to be able to add more tag filters and see all the entries that have been tagged as _both_ speculative fiction and tv shows, or to be able to add still more filters so that I could see all entries that fall under speculative fiction, tv, shows, and heroes, if I wanted to get that specific. It would also be cool to be able to filter by an ‘OR’ command, so that I could sift through all my entries and see all posts that have been tagged as _either_ science fiction _or_ fantasy, for a larger list. I believe that this could easily be done using AJAX to add and remove tags at will. “bbPress”:http://bbpress.org already has something like this in place for individual posts, so I don’t think it would require much effort to modify that script slightly to make it do more and go further.

So, any javascript/php geeks out there looking for a new challenge to expand the functionality of some of useful tools to make them even _more_ useful?