【问题标题】:Can I use category slug in wordpress page url?我可以在 wordpress 页面 url 中使用类别 slug 吗?
【发布时间】:2015-01-29 23:12:24
【问题描述】:

我可以在 wordpress 页面 url 中使用类别 slug 吗?我想要页面的以下 url 结构:

/%category%/%postname% => http://example.org/category/pagename

这适用于帖子内容,但不适用于页面。

有什么想法吗?

感谢您的帮助!

【问题讨论】:

    标签: wordpress categories slug


    【解决方案1】:

    使用Custom Post Type Permalinks plugin 手动调整页面的永久链接结构。

    设置页面使用/%postname%,你的帖子使用/%category%/%postname%

    由于您的网页没有类别,因此将它们包含在 URL 中是没有意义的。此外,在永久链接结构中包含类别时要小心。仅使用简短的类别名称并尝试仅将每个帖子包含在一个类别中,否则您的 URL 会变得太长。

    Yoast 有很多additional info and suggestions on using categories in your permalink structure

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-11-15
      • 2016-02-29
      • 1970-01-01
      • 2012-02-29
      • 2012-09-01
      • 2016-05-11
      • 1970-01-01
      相关资源
      最近更新 更多