Wordpress - Custom Taxonomy Pagination

前端 未结 6 1066
我在风中等你
我在风中等你 2020-12-11 21:00

I\'m using:

  • Wordpress 3.4
  • WP-PageNavi 2.82

I register custom taxonomy (catalog)



        
6条回答
  •  星月不相逢
    2020-12-11 21:22

    Put this into your "functions.php" and then regenerate permalinks. It works to me!

    function taxonomy_rewrite_fix($wp_rewrite) {
        $r = array();
        foreach($wp_rewrite->rules as $k=>$v){
            $r[$k] = str_replace('catalog=$matches[1]&paged=','catalog=$matches[1]&page=',$v);
        }
        $wp_rewrite->rules = $r;
    }
    add_filter('generate_rewrite_rules', 'taxonomy_rewrite_fix');
    

    The key is to replace "paged" to "page" into the rewrite rule for your custom taxonomy.

    This is my first contribution here. Hope I help you.

提交回复
热议问题