Php wordpress自定义添加\重写\规则不适用于分页

Php wordpress自定义添加\重写\规则不适用于分页,php,wordpress,url-rewriting,Php,Wordpress,Url Rewriting,我的functions.php文件中有以下函数。它的作用是允许我同时使用两个自定义分类法 function nfh_custom_rewrite_rules() { add_rewrite_rule('^product_cat/(.*)/bins/(.*)?', 'index.php?product_cat=$matches[1]&bins=$matches[2]', 'top'); } add_action('init', 'nfh_custom_rewrite_rules');

我的functions.php文件中有以下函数。它的作用是允许我同时使用两个自定义分类法

function nfh_custom_rewrite_rules() {
   add_rewrite_rule('^product_cat/(.*)/bins/(.*)?', 'index.php?product_cat=$matches[1]&bins=$matches[2]', 'top');
}
add_action('init', 'nfh_custom_rewrite_rules');
所以我可以有这样一个URL:

mysite.com/product_cat/homeware/bins/promo/
。。这个很好用

我遇到的问题是分页似乎不起作用。我一翻到第2页:

mysite.com/product_cat/homeware/bins/promo/page/2/
它只是抛出一个未找到的错误


任何帮助都将不胜感激

我没有测试,但检查如下。这可能会有所帮助

function nfh_custom_rewrite_rules() {
   add_rewrite_rule('^product_cat/(.*)/bins/(.*)/page/([0-9]{1,})/?', 'index.php?product_cat=$matches[1]&bins=$matches[2]&paged=$matches[3]', 'top');
}
add_action('init', 'nfh_custom_rewrite_rules');

您是否需要使用代码或插件使其更可取?很高兴为您提供帮助:)