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.





July 4th, 2006 at 4:44
Rudd-O - next time you make a plug-in, you should ask me to write the explanation for it. I’ll write it in English, not geekspeak!
July 13th, 2006 at 7:46
Can anybody help me in getting sinlge profile for phpbb and wordpress i need it urgent
.
July 18th, 2006 at 10:34
Hi there, first I have to comment on your blog….it’s absolutely BEAUTIFUL!!! I was bowled over the minute I surfed here.
Now the plugin…I installed the Main Categories plugin, and it sounds like exactly what I’m needing. I’m in the process of transferring an enormous site from plain old html to WordPress and I try so hard to keep materials categorized for the easiest access possible.
So it installed fine, and now I’m clicking in the manage categories section and when I tick a cat to set is as main, I get a page that says the following:
Warning: Cannot modify header information - headers already sent by (output started at /home/htdocs/wp-admin/admin-header.php:16) in /home/htdocs/wp-content/plugins/wp-list-main-cats/wp-list-main-cats-ajax.php on line 17
I can click back on Categories and all looks fine (I haven’t yet put the php code in my theme pages yet). So looks like it’s working okay except for the error message I get when I tick.
I’m running WP 2.0.3 and downloaded the latest copy of your plugin. Any advice?
Thanks, Juli
July 19th, 2006 at 20:29
I’m in the same boat as Juli–WP 2.03, same error message.
July 19th, 2006 at 20:40
This is a bug that occurs when another plugin issues output before Main categories for WordPress. Can you please tell me which plugins you have enabled?
August 12th, 2006 at 14:14
Rudd-O, this error message occurs even if no other plugin is enabled (using WP 2.0.4).
August 14th, 2006 at 2:40
Uh, I wouldn’t know what’s going on then.
November 14th, 2006 at 21:44
Hi! Could you please elaborate the following?
add the wp_list_main_cats() tag (perhaps in replacement to the wp_list_cats()) on your template
I have been trying to install this plugin but has not been successful. I get this error message.
Warning: Invalid argument supplied for foreach() in /hsphere/local/home/prajakal/prajakala.org/mag/wp-includes/template-functions-category.php on line 321
No categories
Thank you. waiting for your help.
January 26th, 2007 at 20:59
Hi there,
Sounds like a great plugin, exactly what I’m looking for a client. However, it doesn’t seem to be working in the latest version of Wordpress (2.1).
Any thoughts to making it work in that version? Here’s my test playground, you’ll see the “No categories” being returned where I put wp_list_main_cats(), at the very top of the sidebar.
http://wordpress.wizardev.ca/
Any help greatly appreciated.
Thanks!
February 9th, 2007 at 17:04
Hey, great plugin if it would work
For me with wp 2.1 i couldnt find out how to DEFINE what is a maincategory and what a secondary. Digging in the src showed me it is somehow achieved via js, but my “Manage categories” panel in wordpress doesnt change, while the script is correctly in the source of the page and the javascript vm did not give any errors.
I tried to insert “maincats” into wp-options table, but i couldnt figure out what option_value to set.
so could you please be more specific HOW to setup maincats and secondary cats?
Greetz
Dyna
September 2nd, 2007 at 14:49
using WP 2.2.2 - trying out but no way to define main categories — the category panel is the old stale wordpress default one.
October 4th, 2007 at 9:17
This plugin realy useful. Thank’s
December 27th, 2007 at 6:50
Why is there this heading “This plugin is obsolete”?