0

我目前正在一个 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',
),) );

非常欢迎有关这方面的任何信息

4

1 回答 1

2

您忘记在数组
'taxonomies' => array('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',
),) );
于 2012-10-23T16:57:16.493 回答