WordPress.org

Forums

RFC: Hierarchical Categories (12 posts)

  1. TechGnome
    Moderator
    Posted 11 years ago #

    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?
    TG

  2. TechGnome
    Moderator
    Posted 11 years ago #

    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).
    TG

  3. tcervo
    Member
    Posted 11 years ago #

    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...)
    -tony
    http://www.tcervo.com

  4. TechGnome
    Moderator
    Posted 11 years ago #

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

  5. davidchait
    Member
    Posted 11 years ago #

    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 http://www.chait.net 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.
    =d

  6. HateSpitLove
    Member
    Posted 11 years ago #

    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: http://wordpress.org/support/3/1552

  7. Lester Chan
    Member
    Posted 11 years ago #

    hey i would love sub categories in wordpress

  8. kinger
    Member
    Posted 11 years ago #

    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.

  9. Matt Mullenweg
    Troublemaker
    Posted 11 years ago #

    Category hierarchy is implemented in 1.1.

  10. jAmOOi
    Member
    Posted 9 years ago #

    Hello,

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

    In the sidebar.php you can put the following :

  11. <h2><?php _e('Categories'); ?></h2>
      <?php wp_list_cats('sort_column=name&hide_empty=0&optioncount=1'); ?>
  12. 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 http://www.starterstarter.com.

    Happy WP-ing !

  • jAmOOi
    Member
    Posted 9 years ago #

    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'); ?>
  • jAmOOi
    Member
    Posted 9 years ago #

    Okay I give up, well anyway, this

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

    is the core.

    Good luck !

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags

    No tags yet.