我正在尝试在wordpress网站上实现一些重写规则来重写我的网址,例如:
词汇表/术语=a
自
词汇表/术语/A
我已经将以下代码添加到我的函数中.php并刷新了重写,但没有运气?
add_rewrite_rule('^glossary/([0-9]+)/?', 'glossary/?terms=$matches[1]', 'top');
任何人都可以指出我正确的方向或建议上述内容不正确的地方吗?
设法让它使用以下重写规则:
add_rewrite_rule('^glossary/term/([a-z]+)/page/([0-9]+)/?$', 'index.php?post_type=glossary&terms=$matches[1]&paged=$matches[2]', 'top');