admin管理员组文章数量:1130349
I have several custom post types, which are properly structured as /%post_type%/%postname%/, however I wish to have the same effect for regular blog entries: /blog/%postname%/
If I prepend the permalink structure with /blog/ it affects the custom post types as well, so currently my permalink structure is simply /%postname%/
Which is the recommended way of doing this? I had a solution involving some rewrites, but the permalink shown in the post editor area does not reflect it.
I have several custom post types, which are properly structured as /%post_type%/%postname%/, however I wish to have the same effect for regular blog entries: /blog/%postname%/
If I prepend the permalink structure with /blog/ it affects the custom post types as well, so currently my permalink structure is simply /%postname%/
Which is the recommended way of doing this? I had a solution involving some rewrites, but the permalink shown in the post editor area does not reflect it.
Share Improve this question asked Jun 17, 2012 at 11:25 Mythical FishMythical Fish 4054 silver badges17 bronze badges1 Answer
Reset to default 15Set the 'with_front' parameter for the post type’s slug to FALSE:
'rewrite' => array (
'slug' => 'posttypeslug',
'with_front' => FALSE
),
I have several custom post types, which are properly structured as /%post_type%/%postname%/, however I wish to have the same effect for regular blog entries: /blog/%postname%/
If I prepend the permalink structure with /blog/ it affects the custom post types as well, so currently my permalink structure is simply /%postname%/
Which is the recommended way of doing this? I had a solution involving some rewrites, but the permalink shown in the post editor area does not reflect it.
I have several custom post types, which are properly structured as /%post_type%/%postname%/, however I wish to have the same effect for regular blog entries: /blog/%postname%/
If I prepend the permalink structure with /blog/ it affects the custom post types as well, so currently my permalink structure is simply /%postname%/
Which is the recommended way of doing this? I had a solution involving some rewrites, but the permalink shown in the post editor area does not reflect it.
Share Improve this question asked Jun 17, 2012 at 11:25 Mythical FishMythical Fish 4054 silver badges17 bronze badges1 Answer
Reset to default 15Set the 'with_front' parameter for the post type’s slug to FALSE:
'rewrite' => array (
'slug' => 'posttypeslug',
'with_front' => FALSE
),
本文标签: How to prefix post permalinks with blogwithout affecting custom post types
版权声明:本文标题:How to prefix post permalinks with blog - without affecting custom post types? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749233613a2336907.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论