我目前正在创建一个Wordpress网站,我创建了一些自定义的帖子类型,所有工作都很好,创建帖子等。
我需要的是自定义分类法和一些自定义的帖子类型,我已经设置了这个,并且当它在分类中添加不同的标签时,它可以工作,当在分类块中为自定义帖子类型创建帖子时单击添加标记它只是#Member news Category-add
的锚链接没有其他事情发生,这不是一个大错误,但我想解决这个问题,因此我的生活时间是正确的
这是一个已知的错误吗?或者在创建自定义帖子类型时我可能错过了什么?
register_post_type('member_news', array( 'label' => 'Member News','description' => 'News content submitted by members of RRUKA.','public' => true,'show_ui' => true,'show_in_menu' => true,'capability_type' => 'post','hierarchical' => false,'rewrite' => array('slug' => 'member-news'),'query_var' => true,'has_archive' => true,'exclude_from_search' => false,'menu_position' => 5,'supports' => array('title','editor','excerpt','trackbacks','revisions','thumbnail','author','page-attributes',),'labels' => array (
'name' => 'Member News',
'singular_name' => 'Member News',
'menu_name' => 'Member News',
'add_new' => 'Add Member News',
'add_new_item' => 'Add New Member News',
'edit' => 'Edit',
'edit_item' => 'Edit Member News',
'new_item' => 'New Member News',
'view' => 'View Member News',
'view_item' => 'View Member News',
'search_items' => 'Search Member News',
'not_found' => 'No Member News Found',
'not_found_in_trash' => 'No Member News Found in Trash',
'parent' => 'Parent Member News',
),) );
任何关于此的信息都将非常受欢迎
答案 0 :(得分:2)
您忘了在数组中添加此参数
'taxonomies'=>数组('category','post_tag'),
register_post_type('member_news', array( 'label' => 'Member News','description' => 'News content submitted by members of RRUKA.','public' => true,'show_ui' => true,'show_in_menu' => true,'capability_type' => 'post','hierarchical' => false,'rewrite' => array('slug' => 'member-news'),'query_var' => true,'has_archive' => true,'exclude_from_search' => false,'menu_position' => 5,'supports' => array('title','editor','excerpt','trackbacks','revisions','thumbnail','author','page-attributes',),
'taxonomies' => array('category', 'post_tag') ,
'labels' => array (
'name' => 'Member News',
'singular_name' => 'Member News',
'menu_name' => 'Member News',
'add_new' => 'Add Member News',
'add_new_item' => 'Add New Member News',
'edit' => 'Edit',
'edit_item' => 'Edit Member News',
'new_item' => 'New Member News',
'view' => 'View Member News',
'view_item' => 'View Member News',
'search_items' => 'Search Member News',
'not_found' => 'No Member News Found',
'not_found_in_trash' => 'No Member News Found in Trash',
'parent' => 'Parent Member News',
),) );