我想添加我自己的重写规则到Wordpress,但我无法使它工作。怎么了?
function rcl_custom_rewrite_rule() {
add_rewrite_tag('%post-group%','([^&]+)');
add_rewrite_rule('^recipe/(.*?)$', 'index.php?post-group=$matches[1]', 'top');
}
add_action('init', 'rcl_custom_rewrite_rule');发布于 2013-11-28 07:37:41
你确定它不管用吗?这些规则不会将某些内容写入htaccess文件。你检查过你的规则是如何手动工作的吗?
还要确保在添加这些规则之后执行函数规则。
https://stackoverflow.com/questions/20259574
复制相似问题