我想更改默认帖子类型的年度/月度存档URL的结构\'post\'
.
正如我们所知,默认URL如下所示:
默认值:http://wwww.domain.com/2013/09
但是想要重写它们,所以就这样结束:
新建:http://wwww.domain.com/about/blog/archive/2013/09
我尝试了以下内容,但似乎确实有效:
add_rewrite_rule("about/blog/archive/([0-9]{4})/([0-9]{2})/page/?([0-9]{1,})/?",\'index.php?post_type=post&year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]\',\'top\');
add_rewrite_rule("about/blog/archive/([0-9]{4})/([0-9]{2})/?",\'index.php?post_type=post&year=$matches[1]&monthnum=$matches[2]\',\'top\');
add_rewrite_rule("about/blog/archive/([0-9]{4})/page/?([0-9]{1,})/?",\'index.php?post_type=post&year=$matches[1]&paged=$matches[2]\',\'top\');
add_rewrite_rule("about/blog/archive/([0-9]{4})/?",\'index.php?post_type=post&year=$matches[1]\',\'top\');
我想有人指出正确的方向,需要更多信息,请留下评论。
谢谢