Categories & Archives

Category and archive templates all fall into the same family of templates. These files are used to present a listing of blog posts within a specific type of archive such as a date or category archive. While pages are organize via parent/child relationships, posts can be assigned to categories and tags.

I like to think of categories as general sections—like you might see in a grocery store. You might have categories for meat, produce, dairy, etc. For specific topics within a category you might create sub-categories such as pork, vegetables and cheese. Then to be more precise you can use tags such as bacon, peapods and Brie. This is a great way to organize posts as it makes it easier for visitors to browse by topic or find posts related to the one they are reading.

Blog posts can also be organized by date, which makes it handy for visitors to see what is most recent.

Category and Archive Templates
The date template controls how an archive for a particular period of time will work. This can be used for yearly, archives, monthly or even by day. uses the date.php template.
The category template controls how an archive for a topical category will work. Category archives can also be customized by category slug or id. If you had 3 categories, meat, produce and dairy, and you wanted to add a different opening paragraph to each you could do that by making unique category templates such as category-meat.php or category-52.php if that was the id for the meat category.
The tag template controls how an archive for a specific tag will work. Like category archives these can also be customized on a per-tag basis by tag slug or id.
Custom taxonomies are handy for when regular categories aren't enough. Categories and tags are taxonomies that come with WordPress, but you can create your own for specific needs. For example if you reviewed books and movies you might create a media taxonomy that would include items such as books and movies, while using categories to differentiate genres such as horror or comedy. Like category and tag archives these can also be customized by slug or id. The Essential Guide to WordPress 3.0 Custom Taxonomies offers a good explanation of taxonomies.
The author template controls how an archive for a posts by a particular author will look. This comes in handy if you have multi-author blogs and want people to be able to browse by author.
Category and Archive Formats

On most blogs when you go to an archive you will see full posts with 3-5 on a page then a link to view previous pages. This can them very difficult to browse. Thankfully you can modify the loop to suit your needs. Instead of publishing full posts, you can publish headlines with excerpts, headlines with excerpts and a thumbnail image or just a list of headlines. I tend to go with the latter.

These templates also allow you to include other helpful information such as the date an item was posted, the author name, the number of comments, etc.

Category RSS Feeds

If you publish a lot of content that falls into distinct categories you can also create custom RSS feeds for each. While I don't blog as often as I should, I've done this on my site. For example on you will see the RSS feed at the top of the page.