Pagination url rewriting
-
Hi,
Why when i run this function the pagination doesn’t work.
Error 404.
if you have any suggestions, I’m interested.
Thank you beforehandfunction filter_post_link($permalink, $post) { if ($post->post_type != 'post') return $permalink; return 'the-blog'.$permalink; } add_filter('pre_post_link', 'filter_post_link', 10, 2); add_action( 'generate_rewrite_rules', 'add_blog_rewrites' ); function add_blog_rewrites( $wp_rewrite ) { $wp_rewrite->rules = array( 'the-blog/([^/]+)/?$' => 'index.php?name=$matches[1]', 'the-blog/[^/]+/attachment/([^/]+)/?$' => 'index.php?attachment=$matches[1]', 'the-blog/[^/]+/attachment/([^/]+)/trackback/?$' => 'index.php?attachment=$matches[1]&tb=1', 'the-blog/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]', 'the-blog/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]', 'the-blog/[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$' => 'index.php?attachment=$matches[1]&cpage=$matches[2]', 'the-blog/([^/]+)/trackback/?$' => 'index.php?name=$matches[1]&tb=1', 'the-blog/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?name=$matches[1]&feed=$matches[2]', 'the-blog/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?name=$matches[1]&feed=$matches[2]', 'the-blog/([^/]+)/page/?([0-9]{1,})/?$' => 'index.php?name=$matches[1]&paged=$matches[2]', 'the-blog/([^/]+)/comment-page-([0-9]{1,})/?$' => 'index.php?name=$matches[1]&cpage=$matches[2]', 'the-blog/([^/]+)(/[0-9]+)?/?$' => 'index.php?name=$matches[1]&page=$matches[2]', 'the-blog/[^/]+/([^/]+)/?$' => 'index.php?attachment=$matches[1]', 'the-blog/[^/]+/([^/]+)/trackback/?$' => 'index.php?attachment=$matches[1]&tb=1', 'the-blog/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]', 'the-blog/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]', 'the-blog/[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$' => 'index.php?attachment=$matches[1]&cpage=$matches[2]', ) + $wp_rewrite->rules; }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Pagination url rewriting’ is closed to new replies.