How to Update your Old Theme for WordPress 2.3: Tags

WordPress Tag Cloud One frequent question from users of our old themes that upgraded to WordPress 2.3 is to do with tags and how to include them in the theme templates.

Tags are very useful for Search Engine Optimization (SEO), especially when it serves as a keyword to describe your post, while it is ridiculously simple to add these tags to your template, a walk through is warranted for those less familiar with manipulation WordPress theme templates.

So here we go.

  • Login to your WP Admin from http://yoursite.com/wp-admin
  • Click on Presentation
  • Click Theme Editor
  • Click Main Index Template (to add tags to the home page) or Click Single Post (if one exists to add it only to single post/permalink page)

Once there, decided if you want to keep the existing category tags or if you need to replace it. The category tag used in older version of WordPress will either be:

< ?php the_category(', ') ?>

or

< ?php wp_list_cats(); ? > (deprecated in version 2.1)

If you want to add tags to the very location where your categories are, simply replace that category tags with this new Tags tag:

< ?php the_tags(); ?>

Else, find an appropriate location for your tags within the theme loop and add the tag there. The new Tags feature does more than just list tags, for example, you can create tag clouds using this simple tag:

< ?php wp_tag_cloud(''); ?>

Converting your existing categories into Tags is easier than ever, go to:

WP Admin > Manage > Import

The built-in converter does the magic of converting Categories of your choice to Tags.

Many new tag functions are in the works, so keep an eye out on this page in Codex.
If you are a PHP programmer, do share your ideas and expertise on Codex to improve the tag feature. Our future themes will include a conditional code for Tags for WordPress 2.3 users.

If you plan on copy pasting the code as is from this tutorial, you will need to remove the space after < and before > that were added in this post for all PHP tags to avoid executing the code.

Leave a Comments | Trackback | RSS 2.0

  1. 1. mia | November 5, 2007 #

    Thank you for the tips, I got tags going on my site now!!!

Have Your Say »

(Required- use your name, not keywords)

(Required- will not be published)

(Optional)

Use SimpleCode while pasting codes.