我有一个名为“资源”的自定义帖子类型。
How I\'ve defined the taxonomy:
register_taxonomy(
\'resource\', // the name of the taxonomy
\'resources\', // post type name
array(
\'hierarchical\' => true,
//\'label\' => \'Resources\', // display name
\'query_var\' => true,
\'rewrite\' => array(
\'slug\' => \'resources\', // This controls the base slug that will display before each term
\'with_front\' => false // Don\'t display the category base before
)
)
);
How I\'ve registered the post type:
register_post_type(
\'resources\',
tp_build_post_args(
\'resources\', \'Resource\', \'Resources\',
array(
\'menu_icon\' => \'dashicons-welcome-write-blog\',
\'menu_position\' => 20,
\'has_archive\' => true,
\'public\' => true,
\'supports\' => array(\'editor\', \'title\',\'author\',\'thumbnail\', \'revisions\'),
\'taxonomies\' => array(\'post_tag\', \'type\', \'sector\')
)
)
);
正如你所看到的,我没有category
在中选择的选项\'taxonomies\' => array(\'post_tag\', \'type\', \'sector\')
, 但它在管理中显示为一个选项:为什么会这样?