自定义POST类型,具有复数(存档)和单数的弹头 时间:2018-11-01 作者:Rodrigo Butzke 我一直在寻找一种方法,为自定义帖子提供“两个”Slug,让我举个例子:www.mywebsite.com/articles/ or www.mywebsite.com/articles/page/2/ for the archive www.mywebsite.com/article/%post-name%/ for the single custom post 1 个回复 最合适的回答,由SO网友:Milo 整理而成 这两个都由传递给的参数控制register_post_type, 具体而言rewrite 和has_archive 参数:$args = [ \'rewrite\' => [\'slug\' => \'article\'], \'has_archive\' => \'articles\', // the rest of your arguments... ] 结束 文章导航