您可以使用以下代码
add_action( \'init\', function () {
$post_type = \'post\';
$post_type_object = get_post_type_object( $post_type);
$post_type_object->has_archive = \'true\';
$post_type_object->rewrite = array(
\'slug\' => \'<YOUR_SLUG>\',
);
register_post_type($post_type, $post_type_object);
} );
除此之外,您还可以添加重写规则来处理:
add_rewrite_rule( \'^<YOUR_SLUG>$\',\'index.php?post_type=post\',\'top\' );
add_rewrite_rule( \'^<YOUR_SLUG>/page/([0-9]{1,})/?$\',\'index.php?post_type=post&paged=$matches[1]\',\'top\' );