【问题标题】:Wordpress: Permalinks for custom post types with_front causing rediect loopsWordpress:自定义帖子类型的永久链接 with_front 导致重定向循环
【发布时间】:2013-01-27 23:23:51
【问题描述】:

所以在搜索谷歌并通过 SO 之后,我发现添加

'with_front' => false`

对新内容类型的重写属性,使得

'rewrite' => array('slug' => 'Venue','with_front' => false)

应删除前置目录(例如 blog/,默认为我的其他页面)。

但是,它只是导致重定向循环..

我的默认前置固定链接是blog/,这通常很好。但是,我有一个自定义内容类型 event,我不希望在前面添加 blog/

发生了什么:url.com/blog/event/new-event-12/

我想要的:url.com/event/new-event-12/

另外一种/最好的方法是什么?

谢谢!!

【问题讨论】:

标签: php wordpress url-rewriting custom-post-type permalinks


【解决方案1】:

好的,这样就可以了。

我不知道您必须刷新永久链接才能使新代码生效。

最简单的方法是转到永久链接设置页面并点击保存。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-07-03
    • 2012-02-22
    • 1970-01-01
    • 1970-01-01
    • 2021-06-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多