我的答案来自this page.
最终代码:
add_action(\'init\',\'yoursite_init\');
function yoursite_init() {
global $wp,$wp_rewrite;
$wp->add_query_var(\'sermon_name\');
$wp_rewrite->add_rule(\'sermon/([^/]+)/?\', \'index.php?pagename=sermons&sermon_name=$matches[1]\', \'top\');
}
谢谢!