我讨厌在这里尝试重新设计轮子,但建议的帖子似乎都无法回答我的问题。我正在为30名30岁以下的获奖者建立一个系统,基本上是作为一个图像组合来设置的。我正在创建的帖子类型将被称为“获奖者”,整体菜单将被称为“30岁以下”。它们都显示在公文包页面上http://domain.com/30under30/ 但由于某些原因,这些帖子被创建为http://domain.com/honoree/%honoree-name%/
How do I change the my taxonomy follow menu name, as opposed to post type name? 函数中代码的标签部分。php如下
function project_custom_init()
{
$labels = array(
\'name\' => _x(\'Honorees\', \'post type general name\'),
\'singular_name\' => _x(\'Honoree\', \'post type singular name\'),
\'add_new\' => _x(\'Add New\', \'honoree\'),
\'add_new_item\' => __(\'Add New Honoree\'),
\'edit_item\' => __(\'Edit Honoree\'),
\'new_item\' => __(\'New Honoree\'),
\'view_item\' => __(\'View Honoree\'),
\'search_items\' => __(\'Search Honorees\'),
\'not_found\' => __(\'No honorees found\'),
\'not_found_in_trash\' => __(\'No honorees found in Trash\'),
\'parent_item_colon\' => \'\',
\'menu_name\' => \'30 Under 30\'
);
$args = array(
\'labels\' => $labels,
\'public\' => true,
\'publicly_queryable\' => true,
\'show_ui\' => true,
\'show_in_menu\' => true,
\'query_var\' => true,
\'rewrite\' => true,
\'capability_type\' => \'post\',
\'has_archive\' => true,
\'hierarchical\' => false,
\'menu_position\' => null,
\'supports\' => array(\'title\',\'editor\',\'author\',\'thumbnail\',\'excerpt\',\'comments\')
);
// The following is the main step where we register the post.
register_post_type(\'honoree\',$args);
// Initialize New Taxonomy Labels
$labels = array(
\'name\' => _x( \'Tags\', \'taxonomy general name\' ),
\'singular_name\' => _x( \'Tag\', \'taxonomy singular name\' ),
\'search_items\' => __( \'Search Types\' ),
\'all_items\' => __( \'All Tags\' ),
\'parent_item\' => __( \'Parent Tag\' ),
\'parent_item_colon\' => __( \'Parent Tag:\' ),
\'edit_item\' => __( \'Edit Tags\' ),
\'update_item\' => __( \'Update Tag\' ),
\'add_new_item\' => __( \'Add New Tag\' ),
\'new_item_name\' => __( \'New Tag Name\' ),
);
// Custom taxonomy for Honoree Tags
register_taxonomy(\'tagportfolio\',array(\'honoree\'), array(
\'hierarchical\' => true,
\'labels\' => $labels,
\'show_ui\' => true,
\'query_var\' => true,
\'rewrite\' => array( \'slug\' => \'tag-portfolio\' ),
));
任何帮助都将不胜感激。我正在尽我最大的努力理解代码,因为我明白了这一点。