admin管理员组

文章数量:1323736

I have several Custom Category Taxonomies but what I am wondering is, if it's possible to have a second set of "tags"?

I am using my tags for a very specific purpose (the naming of cities) so I don't want to mix up that with what I need for another set of tags.

Sure, I can create another Category Taxonomy but the quantity of items means that a "tag" environment might be better...

Thanks

I have several Custom Category Taxonomies but what I am wondering is, if it's possible to have a second set of "tags"?

I am using my tags for a very specific purpose (the naming of cities) so I don't want to mix up that with what I need for another set of tags.

Sure, I can create another Category Taxonomy but the quantity of items means that a "tag" environment might be better...

Thanks

Share Improve this question asked Sep 15, 2020 at 10:08 HenryHenry 9831 gold badge8 silver badges31 bronze badges 1
  • Custom taxonomies don't have to be hierarchical like categories, they can be non-hierarchical like tags, in fact tags are just a non-hierarchical taxonomy – Tom J Nowell Commented Sep 15, 2020 at 12:02
Add a comment  | 

1 Answer 1

Reset to default 1

No, you can't have 2 groups of a singular taxonomy, so there is no way to separate post tags from each other without introducing hierarchy.

However, you could register a city taxonomy and declare that it's non-hierarchical. That's the primary difference between categories and tags. Categories have hierarchy, tags do not. Any taxonomy you register this way will have the same UI as tags.

For example, I registered a talk tag taxonomy for a CPT on my own site:

I just set hierarchical to false when I registered it.

In general, don't repurpose tags and categories for things, just register a new taxonomy, it saves a lot of trouble and makes your life easier.

本文标签: custom post typesIs it possible to have quottwoquot sets of tags