Updating from Categories to Tags in WordPress
I updated my WordPress installation to the version 2.3.x and found a new feature: tags.
I converted all my categories to tags (except the Uncategorized category) and… what I saw a small disaster :) All categories disappeared (an expected result), but the categories list in my sidebar contained only one, not very useful, item Uncategorized. Additionally a blog entry contained only Filed under: Uncategorized, again, not very helpful.
And then I realised – I have my own theme… arrrrgh…. and there is no tags to categories converter ;>
Well, here are steps how to update your own theme to support basic tags features:
1. Blog Entry
We are going to change from Filed under: Uncategorized to Tagged with: English • Photos • Travelling.
Open the wp-content/themes/YOUR_THEME/index.php
file and change:
-
span style=”color: #ff0000;”>"Filed under:"‘,’
to
-
span style=”color: #ff0000;”>’Tagged with: ‘,‘ • ‘,”
2. Sidebar
We are going to remove the obsolete categories list and replace it with a new shiny tag cloud:
Open the wp-content/themes/YOUR_THEME/sidebar.php
file and change:
-
<li id="categories"‘Categories:’
to
-
<li id="categories"‘Tags:’”
Actually, I decided for smaller font sizes:
-
span style=”color: #ff0000;”>’largest=18′
Please, do not forget to click on [Show Plain Code] before copying source code.
For more details about the new commands see the version 2.3 announcement.
For more details about categories and tags see this apt blog entry: Tags Are Not Categories – Got It?.