【发布时间】:2015-07-10 19:52:21
【问题描述】:
我创建了 CPT 并添加了一个分类类别。 问题是来自 CPT 的那些类别也出现在我的博客中。 我想在我的博客中有不同的类别,在我的 CPT 作品集中有不同的类别。
这是我当前的代码 add_action('init', 'create_post_type'); 函数 create_post_type() {
register_post_type( 'portfolio',
array(
'labels' => array(
'label' => 'portfolio',
'name' => __( 'Portfolio' ),
'singular_name' => __( 'portfolio' )
),
'public' => true,
'has_archive' => true,
'taxonomies' => array('category','post_tag'),
'supports' => array( 'title', 'comments', 'excerpt', 'custom-fields', 'thumbnail' )
)
);
};
【问题讨论】:
标签: wordpress categories custom-post-type taxonomy