wordpress - Wordpress // 删除 URL 的帖子类型 slug
问题描述
我创建了一个 CPT 和几个应用于此 CPT 的自定义分类法。
目前我的网址如下(使用插件):
www.example.com/[cpt]/[taxonomy-term]/post
对于特定的 cpt,我想移至:
www.example.com/[taxonomy-term]/post
我怎样才能做到这一点?
解决方案
如果您想在没有[cpt]
自定义 post_type 的情况下使用自定义 slug,则需要在 args 数组中传递此值
$args['rewrite'] = array(
'slug' => 'your-custom-post-type',
'with_front' => false,
),
在此更新您的永久链接之后
推荐阅读
- r - 如何使用 ggplot barplot 绘制表函数的结果(x 轴值问题)
- redundancy - 您能否在现有的 Apache Geode 区域上增加复制?
- sql-server - 在“)”附近预期条件的上下文中指定的非布尔类型的表达式
- r - 如何使用 r 中的 lavaan 包获取 CFA 中因子的相关矩阵和 p 值?
- javascript - res.redirect 错误 [ERR_HTTP_HEADERS_SENT]:在将标头发送到客户端后无法设置标头
- python-3.x - 在linux系统上构建python包后如何访问资源文件
- sas - 网格单元的 SAS 点计数
- vue.js - 如果我的变量是数组,如何更改 vuex 中的状态
- android - Firebase 身份验证返回按钮
- networking - 托管在 Amazon EC2 实例上时,Websocket 客户端未连接到服务器