假设您没有使用插件来处理帖子类型,而是手动注册它们:
添加rewrite 与您的register_post_type() 函数调用。
$rewrite = array(
\'slug\' => $slug,
\'with_front\' => false
);
$args = array(
// your other arguments
\'rewrite\' => $rewrite
);
register_post_type( \'name_of_your_post_type\', $args );
如果您使用某个插件注册帖子类型,请检查它是否有可设置的选项
with_front 到
false. 默认为
true (不幸的是,为了你)。
我不知道是否有插件具有此功能-从未使用过post类型插件。