开发者

wordpress custom post type rewrite rule pagination for author

I'm using Wordpress 3.0.1 and I have made a custom post-type called 'dienasgramatas'. My plugin also makes custom rewrite rules for displaying all posts from this po开发者_开发知识库st type, and even a custom permalink structure to query posts with this post type coming from a defined author. But I can't create a rule for pagination:

The one rule that works:

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

It gives this rewrite rule:

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

But this rule:

$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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜