admin管理员组文章数量:1287856
My client wants to add /news/ at the beginning of the url of his blogposts, but doing so, it adds /news/ to the start of all post types.
Even trying to use some 'custom permalink' plugins, the /news/ is forced to all urls. No matter the type.
Is there a way to add something to the URL of the blogs, but not to the URL of other post types?
My client wants to add /news/ at the beginning of the url of his blogposts, but doing so, it adds /news/ to the start of all post types.
Even trying to use some 'custom permalink' plugins, the /news/ is forced to all urls. No matter the type.
Is there a way to add something to the URL of the blogs, but not to the URL of other post types?
Share Improve this question asked Sep 13, 2021 at 16:05 Fredy31Fredy31 8782 gold badges16 silver badges31 bronze badges1 Answer
Reset to default 1In creating your post types register_post_type
) you need to add with_front as false:
'with_front' (bool) Whether the permastruct should be prepended with WP_Rewrite::$front. Default true.
so your rewrite could be
'rewrite' => array ( 'with_front' => false),
or if it's already there with a new slug something like this:
'rewrite' => array('slug' => 'post_slug', 'with_front' => false),
本文标签: permalinksAdding a prefix to the blogbut only the blog
版权声明:本文标题:permalinks - Adding a prefix to the blog, but only the blog 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741322949a2372313.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论