I have a page Heemtijdinghen displaying custom posts (post_type=artikel) paginated. The page is a child page of page Publicaties:
/publicaties/heemtijdinghen/
When navigating to e.g. page 2 a 404 Not Found is thrown:
/publicaties/heemtijdinghen/page/2/ => 404 Not Found
However, pagination does work correctly when I make the child page a parent page:
/heemtijdinghen/page/2/ => OK
I have no clue how to do the rewrite:
add_filter('init', 'plugin_name_add_rewrite_rules');
function plugin_name_add_rewrite_rules() {
add_rewrite_rule('publicaties/heemtijdinghen/(.?.+?)(/[0-9]+)?/?$', 'index.php?post_type=artikel', 'top');
add_rewrite_rule('publicaties/heemtijdinghen/([^/]+)(/[0-9]+)?/?$', 'index.php?post_type=artikel&paged=$matches[1]', 'top');
}
Help would be very much appreciated.