functions.php中的Wordpress添加\重写\规则返回404
我试图在function.php中添加以下代码以添加我自己的重写规则,但它返回404:functions.php中的Wordpress添加\重写\规则返回404,php,wordpress,rewrite,Php,Wordpress,Rewrite,我试图在function.php中添加以下代码以添加我自己的重写规则,但它返回404: add_rewrite_rule('all_comments/([0-9]+)/?$', 'index.php?pagename=all_comments&post_id=$matches[1]', 'top'); 当我试图编写一个测试规则时,它还返回404: add_rewrite_rule('testss$', 'index.php', 'top'); $wp_rewrite->flush
add_rewrite_rule('all_comments/([0-9]+)/?$', 'index.php?pagename=all_comments&post_id=$matches[1]', 'top');
当我试图编写一个测试规则时,它还返回404:
add_rewrite_rule('testss$', 'index.php', 'top');
$wp_rewrite->flush_rules(true);
我的add_rewrite_规则函数肯定有问题,但我无法解决
非常感谢。好吧,最后我发现这是一个名为“重写”的插件,它使用自己的规则列表而不是我自己的规则列表。我删除了它,它现在可以工作了