我为我的projects
自定义帖子类型。
function projects_taxonomy() {
$labels = array(
\'name\' => __(\'projects Categories\'),
\'singular_name\' => __(\'project Category\'),
\'search_items\' => __(\'Search project Categories\'),
\'all_items\' => __(\'All project Categories\'),
\'parent_item\' => __(\'Parent project Category\'),
\'parent_item_colon\' => __(\'Parent project Category:\'),
\'edit_item\' => __(\'Edit project Category\'),
\'update_item\' => __(\'Update project Category\'),
\'add_new_item\' => __(\'Add New project Category\'),
\'new_item_name\' => __(\'New project Category\'),
\'menu_name\' => __(\'project Categories\'),
\'rewrite\' => array(\'slug\' => \'projects\', \'with_front\' => true)
);
$args = array(
\'labels\' => $labels,
\'hierarchical\' => true,
);
register_taxonomy(\'projects-category\', \'projects\', $args);
}
问题是分类法重写工作不正常,指向税务存档页的链接如下所示:
http://www.domain.com/projects-category/first-cat/
而不是(我所期望的):
http://www.domain.com/projects/first-cat/
我尝试过几次通过permalinks设置重新生成htaccess文件。还用wordpress codex检查了我的语法,看起来还可以。是否需要以某种方式启用它?