我正在尝试在wordpress网站上实现一些重写规则来重写我的网址:
词汇表/?术语=α
到
词汇表/术语/ A
我已将以下代码添加到我的functions.php中并刷新了重写但没有运气?
add_rewrite_rule('^glossary/([0-9]+)/?', 'glossary/?terms=$matches[1]', 'top');
有人能指出我正确的方向或建议上述不正确的方法吗?
答案 0 :(得分:0)
管理以使其与以下重写规则一起使用:
add_rewrite_rule('^glossary/term/([a-z]+)/page/([0-9]+)/?$', 'index.php?post_type=glossary&terms=$matches[1]&paged=$matches[2]', 'top');