我有两页。
/client-a/
/client-b/
我有一个自定义的帖子类型,叫做“case”:
$case_type = array(
\'labels\' => $case_labels,
\'public\' => true,
\'publicly_queryable\' => true,
\'show_ui\' => true,
\'query_var\' => \'case\',
\'rewrite\' => array( \'slug\' => \'cases\', \'with_front\' => false ),
\'capability_type\' => \'post\',
\'hierarchical\' => false,
\'menu_position\' => 46,
\'has_archive\' => true,
\'supports\' => array(\'title\',\'editor\'),
);
register_post_type( \'case\' , $case_type );
最后,我有一个自定义分类法,称为“类型”:
register_taxonomy(\'type\',array(\'case\'),array(
\'public\' => TRUE,
\'show_tagcloud\' => FALSE,
\'hierarchical\' => TRUE,
\'labels\' => $categoria_labels,
\'show_ui\' => TRUE,
\'query_var\' => TRUE,
\'rewrite\' => array( \'slug\' => \'genre\', \'with_front\' => false )
))
所有my类型的页面名称都相同:client-a、client-b。
如何重写permalink规则以接受此结构:
client-a/ --> page, lists all \'cases\', uses a template
client-a/subpage --> this is a subpage
client-a/cases/case-a.html --> this is a custom post type WITH the genre "client-a"
client-b/cases/case-b.html --> this is a custom post type WITH the genre "client-b"
这种结构的最佳方法是什么?
当我使用此解决方案时:http://xplus3.net/2010/05/20/wp3-custom-post-type-permalinks/comment-page-1/#comment-1005
我让我的永久链接用于自定义帖子类型和自定义分类法,但会中断所有页面的永久链接。
谢谢