Archived topic
Pagination Issue
1 reply · Started by Mohamed on October 15, 2020
Viewing posts 1–2 of 2
Hi,
I'm using a custom post type "mobiles" and taxonomy "brands" with this code for rewrite the URLs
add_filter( 'init', 'the_rewrite_orocess' );
function the_rewrite_orocess( $vars ){
/* custom post type */
add_rewrite_rule('mobiles/([^/]+)-phones/?$',
'index.php?post_type=mobiles&orderBy=$matches[1]',
'top');
add_rewrite_rule('mobiles/([^/]+)-phones/page/([0-9]+)?$',
'index.php?post_type=mobiles&orderBy=$matches[1]&paged=$matches[2]',
'top');
/* Taxonomy */
add_rewrite_rule('^brand/([^/]*)/([^/]*)?',
'index.php?brands=$matches[1]&orderBy=$matches[2]',
'top' );
add_rewrite_rule('^brand/([^/]+)/page/([0-9]+)?$',
'index.php?brands=$matches[1]&paged=$matches[2]',
'top' );
add_rewrite_rule('^brand/([^/]*)/([^/]*)/page/([0-9]+)?$',
'index.php?brands=$matches[1]&orderBy=$matches[2]&paged=$matches[3]',
'top' );
flush_rewrite_rules();
}
but the pagination return the page 2 loop content but the active is the button number "1" !!
Although it works in the archive of custom post pages
Could you check?
Hi there,
I'm afraid I'm not familiar enough with rewrite rules to spot the issue here.
This would be a good place to ask this question: https://wordpress.stackexchange.com/
This archived topic is closed to new replies.