views:

14

answers:

0

i'm using Wordpress 3.0.1 and i have made custom post-type called 'dienasgramatas'. my plugin also makes custom rewrite rules for displaying all posts from this post type and even custom permalink structure to query posts with this post type coming from defined author, but i can't create rule for pagination:

the one that works:

$new_rules['dienasgramatas' . '/([^/]+)/?$'] = 'index.php?post_type=dienasgramata&author_name=' . $wp_rewrite->preg_index(1);

it gives rewrite rule:

[dienasgramatas/([0-9]{4})/?$] => index.php?post_type=dienasgramata&year=$matches[1]

but this one:

$new_rules['dienasgramatas' . '/([^/]+)/page/?([0-9]{1,})/?$'] = 'index.php?post_type=dienasgramata&author_name=' . $wp_rewrite->preg_index(1) . '&paged=' . $wp_rewrite->preg_index(2);

outputs this (faulty) rewrite rule:

[dienasgramatas/([^/]+)/page/?([0-9]{1,})/?$] => index.php?dienasgramata=$matches[1]&paged=$matches[2]

As you can see, post_type is ignored and this rewrite rule does not work as it should.

Can someone tell me why it's not working or how to make it right?