Pagination for category slug returns 404 when page >= 2

I have a custom type and the slug is:

'rewrite' => array('slug' => 'blog/%blogs_tax%'),

And after register_post_type() I have a function to rewrite the slug variable.

Read More

I works fine, but I have problems with pagination…

When I try to access something like http://www.site.com/blog/job/page/2/ (job is the category), I receive 404.

The pagination with simple slug from an another custom type Like : 'slug' => 'cases/') works fine… the problem happens only when I use a variable in the slug (%blogs_tax% or another).
How to fix it?
Thanks.

Related posts

Leave a Reply

1 comment

  1. I got fix this problem with:

    add_rewrite_rule('blog/([^/]*)/page/([0-9]+)?/?$', 'index.php?post_type=blog&blogs_tax=$matches[1]&paged=$matches[2]', 'top');
    

    In functions.php, after register_post_type.

    Very important: You must flush rules. It is easy to do changing the permalink.