我试图在Wordpress Devlopment网络中提出这个问题没有成功,我试图在固定链接类型的永久链接中只显示3个特定类别 .
现在,永久链接结构(即the theme i'm using给出的结构以及我通过子主题修改的结构)如下:
www.myfoodblog.com/recipes/the-post-title/
^ ^ ^
root custom-post-type title
一些帖子属于3个类别,我想在永久链接中显示 restaurant
, users
和 admin
来得到这样的东西
www.myfoodblog.com/recipes/restaurant/the-post-title/
www.myfoodblog.com/recipes/users/the-post-title/
www.myfoodblog.com/recipes/admin/the-post-title/
将原始结构留给不属于这些类别的帖子 .
我尝试使用this plugin但它会显示所有帖子的自定义帖子类型类别 .
我还尝试按照_2923711中提供的说明进行操作,但它不起作用,永久链接结构中没有进行任何更改 .
任何建议都非常感谢 .
2 回答
您必须同时使用
post_type_link
并添加rewrite rule
创建帖子类型
Important: 查看重写规则:
'rewrite'=> array( 'slug' => 'recipes/%type%' ),
创建自定义分类
添加过滤器类型链接
Important: 毕竟转到永久链接选项并重置它 .