admin管理员组文章数量:1208153
Currently my permalink structure for posts is
domain/post-title
I'm using a static front page and a "blog" page for posts. I'd like to to change the permalink structure for posts, tags and categories to
domain/blog/post-title
I can easily add /blog/ in the permalink structure but the catch is that my custom post types also get this modified permalink structure and that is not the desired result.
Thanks in advance!
Currently my permalink structure for posts is
domain.com/post-title
I'm using a static front page and a "blog" page for posts. I'd like to to change the permalink structure for posts, tags and categories to
domain.com/blog/post-title
I can easily add /blog/ in the permalink structure but the catch is that my custom post types also get this modified permalink structure and that is not the desired result.
Thanks in advance!
Share Improve this question asked Jan 28, 2013 at 20:41 user2019515user2019515 4666 silver badges17 bronze badges1 Answer
Reset to default 16When you register your post type, the with_front
argument of rewrite
should be false
, so the permastruct is not appended to the front of your custom post type permalink.
$args = array(
// snip...
'rewrite' => array( 'with_front' => false ),
// snip...
);
register_post_type( 'your-post-type', $args );
本文标签: Change permalinks for posts but not for custom post types
版权声明:本文标题:Change permalinks for posts but not for custom post types 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738705368a2107877.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论