Main categories for WordPress
This plugin is obsolete.
What this plugin does
With this plugin, you can display selected “main” categories on your blog’s sidebar or top navigation bar. Two methods are provided:
- Akin to
wp_list_cats(), the provided functionwp_list_main_cats()accepts the same arguments, but filters out all categories not deemed “main”. You choose main categories via the WordPress category management administration panel. Another function calledwp_list_secondary_cats()allows for the listing of any secondary (non-main) categories in your blog. - Plus, two included widgets let you create sidebar blocks for main and/or secondary categories.
Just as with wp_list_cats(), when viewing category archive pages, the associated category’s list element is automatically styled with the current-cat class. Thus, integrating this plugin with navigation bars is extremely easy.
Download Main categories for WordPress
Why this is useful
It’s useful when you want to keep a flat category namespace, or separate topics from site sections. For example: you select a few categories to be your ’sections’ by making them main. The other categories can be ‘topics’. That way, you can keep an orthogonal separation between sections and topics on your blog. Thus, the wp_list_main_cats() function comes in handy to generate “main menus” for sidebars or top navigation bars.
More in-depth: hierarchical categories work very well in most settings, but sometimes you want to assign two categories to a post, without having to duplicate a sub-category in another category. Yes, that sounds confusing. Here’s an example.
Suppose you have a Guides category, which contains two sub-categories: Apache and MySQL. You also have an Interview category. What happens when you interview Brian Behlendorf? Should you select Interview, and then the Apache subcategory from the Guides category? It doesn’t make sense, right? Should you duplicate Apache in the Interview category? You can imagine the nightmare on your sidebar, filled with lots and lots of duplicate categories.
Installation and usage
To use:
- deploy into its own wp-plugins/wp-list-main-cats/ directory (basically, preserve the package’s directory structure)
- activate through the plugin manager
- access the Manage panel in the WordPress administrative interface
- go to Categories
- select your main categories
- add the wp_list_main_cats() tag (perhaps in replacement to the wp_list_cats()) on your template
License
As always, it’s GPL, dude.