function rewrite_support() {
$wp_rewrite->flush_rules();
add_rewrite_rule('^support/category/([^/]+)/?$','support-category/?category=$matches[1]','top');
}
add_action( 'init', 'rewrite_support');
这是不是有效的原因?我已将此代码包含在我的functions.php文件中。
/ support-category /?category = category name
应该重定向到:
/ support / category / category name
这似乎不起作用:
答案 0 :(得分:0)
也许:
add_rewrite_rule('^support-category/([^/]+)/?$','index.php?pagename=support/category&category_name=$matches[1]','top');
或
add_rewrite_rule('^support/category/([^/]+)/?$','index.php?pagename=support-category&category_name=$matches[1]','top');