Support » Requests and Feedback » RFC: Hierarchical Categories

  • TechGnome


    Ok, I geeked out there for a sec. RFC means “Request For Comment” meaning I am requesting comments from all y’all regarding hierarchical categories.
    I know this is something that some of us have been looking for in WP, the ability to have Category -> Sub-Categories.
    So, what I am looking for is some comments how all y’all think it should work.
    Obvious items:
    From admin, have the ability to set the parent category of any category
    From posting, show the categories in the hierarchical manner, so it is obvious what cats are under what cats.
    From the index.php (or what have you) show the cats in their hierarchical arrangement
    When selecting a category, also (optionaly) display posts from sub-cats under that cat as well.
    Is there anything I’m missing? Anything you would like to see added to this list?

Viewing 11 replies - 1 through 11 (of 11 total)
  • TechGnome


    1) Yes
    2) Yes
    3) Yes
    At least that’s the plan. I will probably breaking things down into smaller chuncks, but yes, all of that will be available.
    As for why? My site is a springboard for my writing. I have one cat where it all goes, I would like to further categorize it within the parent cat… ie: By type (stories or peoms) and/or by title (Book A vs Book B).



    I’ve never really thought about this (until now), but here goes a possible example:
    I’m currently setting up a second install of WP, in a separate directory, to use for just movies. My categories are really genres (Westerns, Thrillers, Comedy, etc.) If I had the ability to do sub-cat’s, I could incorporate this in my main blog without making my category list huge (and out of context.) Instead, I could simply have “Movies” as a top category, and when the category is selected, *then* the sub categories for that category could be displayed (at least that’s one way of doing it…)



    That’s kinda why I wanted it tcervo, it’s more of an organizational thing than anything else.



    Subcats are good if you really have the unique needs — that is, each major cat has completely different (in general) minor cats under it.
    Otherwise, I’ve implemented >some< of what TG is looking for in ‘resulting feature’ on as my ‘post type’ — basically a second set of categories, except that types are unique (one per post, like orig cats), whereas new 1.0 cats are non-unique.
    You’ll see that my posts all now have an icon representing the post-type (and when clicked brings you to a view-by-type query just like the view-by-cat query does) on the left corner of the post, and the possibly-multiple-categories listed in the inset meta info on the right side of the post.
    This allows me to set the ‘class’ of post (news, preview, review, how-to, etc.) disctinctly from the ‘content area’ (home theater, mobile devices, etc.). It also means that I can have something like a news article talking about both home theater and mobile devices. 😉 You get the picture.
    I decided early on that this simpler ‘definition’ was all I needed (or more specifically precisely what I needed) to accomplish better organization of site content.



    There is a fine line when it comes to categories between being too broad and too complex. CMS’s such as LDU is an example of complexity, i.e. You click a category then there is a middle page that just lists all the sub categories, and then you have to click another link to get to what you want. It works this way throughout the entire site and this just gets plain annoying after awhile. BUT (big “but” there) if implementing subcategories can be integrated in a way that affects the archival scheme without hindering the efficiency of navigation I think this would be an absolutely fantastic idea. You can see my rant, if you haven’t already, if you’re interested:

    hey i would love sub categories in wordpress

    Is this category related to the existing category_parent field? It appears not to be used now, but i’m interested in hearing from the dev team on the intended use.

    Moderator Matt Mullenweg



    Category hierarchy is implemented in 1.1.


    You want categories & subcategories hierchically (and indented) listed in the sidebar ? Here is the solution …

    In the sidebar.php you can put the following :

  • <h2><?php _e(‘Categories’); ?></h2>
      <?php wp_list_cats(‘sort_column=name&hide_empty=0&optioncount=1’); ?>
  • That will display your categories and subcategories, neatly hierarchical and indented (if your .css allows so).

    I just started creating a website, using WordPress, and you can see the above script in action at

    Happy WP-ing !

Oh sh..,

The li and ul tags disappeared in my posting ..

Again :

  • <h2><?php _e(‘Categories’); ?></h2>
      <?php wp_list_cats(‘sort_column=name&hide_empty=0&optioncount=1’); ?>
  • Okay I give up, well anyway, this

    <?php wp_list_cats(‘sort_column=name&hide_empty=0&optioncount=1’); ?>

    is the core.

    Good luck !

    Viewing 11 replies - 1 through 11 (of 11 total)
    • The topic ‘RFC: Hierarchical Categories’ is closed to new replies.