WordPress-自定义分类法未显示在外观>菜单中

问题描述 投票:0回答:1

我有一个名为Resources

的自定义帖子类型
register_post_type(
    'resources',
    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('sector', 'subject', 'type'),
        )
    )
);

我还创建了type的分类法,该分类法已分配给资源:

register_taxonomy(  
    'type', 
    'type', 
    array(  
        'hierarchical' => true,  
        'label' => 'Type',  
        'query_var' => true,
        'rewrite' => array(
            'slug' => 'type', 
            'with_front' => false 
        ) 
    )
); 

在WordPress后端中,这是我所有的type

enter image description here

但是,当我转到外观>菜单>并单击“类别”下拉菜单时,仅显示以下选项:

enter image description here

这是为什么?

wordpress custom-post-type custom-taxonomy
1个回答
0
投票
你好,请添加以下代码,并检查创建resources帖子类型时是否缺少很多东西。

((注意:请删除为创建resources帖子和type分类法添加的所有代码)

© www.soinside.com 2019 - 2024. All rights reserved.