admin管理员组文章数量:1334670
Right now I have changed the posts url using the settings -> permalink i.e /blog/%postname%/
I have now added a CPT and using the rewrite 'rewrite' => array( 'slug' => 'custom-posts' ),
but the urls for this custom posts are now inherriting the /blog/ from the standard posts so the urls look like /blog/custom-posts/post-title-here
when I just want it to be /custom-posts/post-title-here
.
Anyone know of a quick fix to achieve this ?
Right now I have changed the posts url using the settings -> permalink i.e /blog/%postname%/
I have now added a CPT and using the rewrite 'rewrite' => array( 'slug' => 'custom-posts' ),
but the urls for this custom posts are now inherriting the /blog/ from the standard posts so the urls look like /blog/custom-posts/post-title-here
when I just want it to be /custom-posts/post-title-here
.
Anyone know of a quick fix to achieve this ?
Share Improve this question asked Jun 3, 2020 at 10:14 KravitzKravitz 1313 bronze badges 1- Welcome to WordPress Development. I hope you find the answer(s) you are looking for. Our site is different from most - if you have not done so yet, consider checking out the tour and help center to find out how things work. – Matthew Brown aka Lord Matt Commented Jun 6, 2020 at 15:21
1 Answer
Reset to default 2Answer is to use 'with_front' => false in the rewrite array :)
本文标签: permalinksChange URL of posts and also Custom Post Type
版权声明:本文标题:permalinks - Change URL of posts and also Custom Post Type 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742378602a2463661.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论