Top Level Categories Plugin 0.1

posted 2007-02-27

Introduction

The Top Level Categories plugin allows you to remove the prefix before the URL to your category page. For example, instead of fortes.com/category/work, I use fortes.com/work for the address my "work" category. WordPress doesn't allow you to have a blank prefix for categories (they insert category/ before the name), this plugin works around that restriction.

Download

Top Level Categories v0.1

Installation

  1. Download top_level_cats.zip, unzip it and save the top_level_cats.php file in your wp-content/plugins directory.
  2. Activate the plugin through your WordPress admin area (See the official documentation if you need more help with this.)
  3. Go to Options -> Permalinks in your options panel and press Update Permalink Structure.
  4. That's it! Your category links are now changed!

Notes

I use this plugin in conjunction with the excellent Permalink Redirect Plugin. If you're using the plugin, you should make sure to fix a simple bug in the program that messes up category feeds. You can do so by adding the following code to the file on line 174 (right before the return $link; line):

        if (is_feed()) {
            $link = trailingslashit($link) . "feed/";
        }

Known Issues

This plugin will not work if you are using a permalink structure that is only the post name (i.e. /%postname%/ in the options). This is because it creates an ambiguous situation where both categories and individual posts end up with the same URLs. To fix this (if you don't mind switching your post URLs), switch permalink structure to one of the built-in settings (like Date and Name Based).