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 :)
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742378603a4432688.html
评论列表(0条)