admin管理员组文章数量:1328358
I want to add all the blog posts to the /blogs/the-post-name type structure. I can do this through the permalinks settings with:
/blogs/%postname%/
but this also affects custom post types resulting in a
/blogs/custom-post-type/the-custom-post-type-name
How can i add all posts into the blogs folder without adding all my custom post types into the blogs folder?
I want to add all the blog posts to the /blogs/the-post-name type structure. I can do this through the permalinks settings with:
/blogs/%postname%/
but this also affects custom post types resulting in a
/blogs/custom-post-type/the-custom-post-type-name
How can i add all posts into the blogs folder without adding all my custom post types into the blogs folder?
Share Improve this question asked Jul 27, 2020 at 1:35 Daniel FloridoDaniel Florido 31 bronze badge1 Answer
Reset to default 0When registering the custom post types, set with_front
to false
:
register_post_type(
'my_post_type',
[
// ...etc.
'rewrite' => [
'with_front' => false,
],
]
);
The post type URL will then not include anything extra you've added in the Permalinks settings.
本文标签: add all blog posts to folder
版权声明:本文标题:add all blog posts to folder 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742231130a2437233.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论