I've been trying to add a subdirectory to my blog post's permalink for example domain/blog/post-slug/
However, this is affecting the other post types that I've created using Pods such as domain/knowledgebase/ is now domain/blog/knowledgebase/
I would appreciate anyone helping me solve this problem. I still just want a blog as a subdirectory for my posts but I need the other post types not affected by that change.
I've been trying to add a subdirectory to my blog post's permalink for example domain/blog/post-slug/
However, this is affecting the other post types that I've created using Pods such as domain/knowledgebase/ is now domain/blog/knowledgebase/
I would appreciate anyone helping me solve this problem. I still just want a blog as a subdirectory for my posts but I need the other post types not affected by that change.
Share Improve this question asked Oct 21, 2020 at 12:52 Joboy2212Joboy2212 13 bronze badges 2 |1 Answer
Reset to default 1If we look at the register_post_type
documentation, in the rewrite option, there is a sub-option that controls this:
'with_front'
=>bool
Should the permalink structure be prepended with the front base. (example: if your permalink structure is /blog/, then your links will be: false->/news/, true->/blog/news/). Defaults to true
So something like this:
...
'rewrite' => [ 'with_front' => false ],
...
More information on register_post_type
rewrite options
/blog/
prefix? There might be a super easy fix for this but it all assumes you used one specific method of doing it – Tom J Nowell ♦ Commented Oct 21, 2020 at 13:20