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
1 Answer
Reset to default 1No, 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
版权声明:本文标题:custom post types - Is it possible to have "two" sets of tags? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742118842a2421597.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论