最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Create custom post type categories

programmeradmin2浏览0评论

I've created a CPT called 'Projects' in WP using pods. If I now go to the categories sub menu for this CPT I am presented with a long list of categories that were created for the specifically for the default WP Posts.

However, I need cetegories that are limited to the Projects CPT, and not shared with any other post type. I can't seem to find any way to do this. If for example I create a new category it just gets added to the existing list of categories and is again shared with the default WP Posts.

I've created a CPT called 'Projects' in WP using pods. If I now go to the categories sub menu for this CPT I am presented with a long list of categories that were created for the specifically for the default WP Posts.

However, I need cetegories that are limited to the Projects CPT, and not shared with any other post type. I can't seem to find any way to do this. If for example I create a new category it just gets added to the existing list of categories and is again shared with the default WP Posts.

Share Improve this question edited Jan 20, 2020 at 11:38 Phill Healey asked Jan 18, 2020 at 20:14 Phill HealeyPhill Healey 3781 gold badge7 silver badges20 bronze badges 1
  • You should create a custom taxonomy (use register_taxonomy()) and assign projects CPT to it (in second parameter of register_taxonomy() or add to register_post_type() arguments "taxonomies" => array('your_taxonomy_slug') ). – nmr Commented Jan 20, 2020 at 12:24
Add a comment  | 

1 Answer 1

Reset to default 0

You need to create a NEW pod that is a Category type, then simply associate it with your CPT pod.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论