我想知道如何才能添加自定义帖子类型类别作为选项添加为导航菜单项。
我拥有的:
$portfolio_args = array(
\'labels\' => array(
\'name\' => \'Portfolio Items\',
\'singular_name\' => \'Portfolio Item\'),
\'description\' => \'Allows you to build custom portfolio items and link them to categories\',
\'public\' => true,
\'show_ui\' => true,
\'menu_position\' => 20,
\'supports\' => array(\'title\', \'editor\', \'thumbnail\'),
\'has_archive\' => true,
\'rewrite\' => array(\'slug\' => \'portfolio-item\'),
\'can_export\' => true
);
// http://codex.wordpress.org/Function_Reference/register_post_type
register_post_type(\'portfolio\', $portfolio_args);
$categories_labels = array(
\'label\' => \'Categories\',
\'hierarchical\' => true,
\'query_var\' => true
);
// Register taxonomies for extra post type capabilities
register_taxonomy(\'portfolio_categories\', \'portfolio\', $categories_labels);
这很好用。我可以为特定的职位类型创建新类别。我想做的是能够进入wp管理/导航菜单。php,滚动到底部和左侧,查看“categories”下列出的类别。
有什么想法吗?谢谢