[wp-hackers] hierarchical custom taxonomies vs good & old cats.

Andrew Nacin wp at andrewnacin.com
Thu Dec 16 07:22:37 UTC 2010


On Thu, Dec 16, 2010 at 2:09 AM, Haluk Karamete <halukkaramete at gmail.com>wrote:

> My understanding is that if I choose to create a hierarchical custom
> taxonomy say "People", I will not be able to use tags that are under
> its context.
>
> Example case
>
> people   ( this is a custom taxonomy )
>
> ---politicians  ( this is a sub level under the people cus. taxonomy )
>
> And I want to add "obama" as a tag/term under the taxonomy above, i'm
> out of luck. because with hierarchical cust. taxes, all I'm left with
> is either to use post-tags or to create another sub level under
> "politicians" as obama. both options no good. I wonder why I cannot
> have a tag option under hierarchical taxonomies. there gotto be a
> technical limitation on that as far as WP mechanics.
>
> but if I choose people to be non-hierarchical, that I would be able to
> tag items such as obama, mccain, etc easily.
>
> In this case, ( I mean in the non-hierarchical case), I see great
> value and organizational power. And this power is just not there out
> of the box by simply using categories and tags. But the moment, you
> choose to make your custom taxonomy a hierarchical one, you lose a
> lot; your cus. tax. now acts exactly like a top level cat.
>
> In other words, whether you create this structure as a top level
> category titled "people" or as a hierarchical custom taxonomy titled
> "people", it makes no difference as far as practical results.
>
> people
>
> ----politicians
>
> ----celebrities
>
> ----athletes
>
>
> Am I right?


I think you're referring to the URLs, right?

You want:
example.com/people/politicians/obama/

But you're getting:
example.com/obama/

If I'm correct, then you're in luck, WordPress 3.1 (currently in late beta)
contains support for hierarchical URLs for hierarchical taxonomies.

When registering your taxonomy, you'll pass an array to the 'rewrite' flag,
with 'hierarchical' => true.

More here:
http://core.trac.wordpress.org/ticket/12659

Nacin


More information about the wp-hackers mailing list