我正在开发一个使用用户分类法的新主题。用户可以通过用户管理屏幕选择分类法并正确保存。然而,Wordpress只能在前端找到一些用户的分类法。此外,未找到根据选定分类筛选用户的分类页面,因此使用默认存档模板。
Edit: 我已尝试更新我的永久链接
Have any one experienced this before?
下面是我用来注册其中一个分类法的代码:
register_taxonomy(\'Roles\', \'user\', array(
\'public\' =>true,
\'labels\' =>array(
\'name\' =>\'Roles\',
\'singular_name\' =>\'Role\',
\'menu_name\' =>\'Roles\',
\'search_items\' =>\'Search Roles\',
\'popular_items\' =>\'Popular Roles\',
\'all_items\' =>\'All Roles\',
\'edit_item\' =>\'Edit Role\',
\'update_item\' =>\'Update Role\',
\'add_new_item\' =>\'Add New Role\',
\'new_item_name\' =>\'New Role Name\',
\'separate_items_with_commas\'=>\'Separate roles with commas\',
\'add_or_remove_items\' =>\'Add or remove roles\',
\'choose_from_most_used\' =>\'Choose from the most popular roles\',
),
\'rewrite\' =>array(
\'with_front\' =>true,
\'slug\' =>\'author/roles\',
),
\'capabilities\' => array(
\'manage_terms\' =>\'edit_users\',
\'edit_terms\' =>\'edit_users\',
\'delete_terms\' =>\'edit_users\',
\'assign_terms\' =>\'read\',
),
));
下面是我用来显示分类法的代码:
<?php the_terms( $user->ID, \'Roles\', \'<bold>Roller:</bold> \', \', \', \'<br>\' ); ?>