I have been reading around and cannot seem to figure this out.
Everything is working fine except that pagination seems to not work, I am adding a second rewrite rule, shouldn't this fix that?
I can get to the first page fine, but any page beyond throws a 404.
Here is my code:
// Rewrite the Sermon URL
function sermon_rewrite() {
$cpt = 'sermon';
$tax = 'series';
add_rewrite_rule(
'^'.$cpt.'/([^/]+)/([^/]+)/([^/]+)/?',
'index.php?post_type='.$cpt.'&'.$tax.'=$matches[1]&'.$tax.'=$matches[2]&'.$cpt.'=$matches[3]',
'top'
);
add_rewrite_rule(
'sermon/([^/]+)/page/?([0-9]{1,})/?$',
'index.php?post_type='.$cpt.'&'.$tax.'=$matches[1]&paged=$matches[2]',
'top'
);
}
add_action('init','sermon_rewrite');
EDIT
If I go to the following url
This works: mysite.com/sermon/term/childterm/page2/
This does not: mysite.com/sermon/term/childterm/page2/
Any idea what is causing that?