1.这是否与普通的永久链接选项一起使用?设置您的自定义永久链接结构(例如 %postname%)点击保存查看您的单个自定义帖子页面是否返回 404 错误页面如果他们这样做,请返回并将永久链接更改回默认值并保存现在尝试再次设置自定义永久链接并保存来回走动通常有助于解决我的错误,而且我用这种方法取得了很大的成功。2.检查 slug 冲突(具有与您的帖子类型相同的 slug 的页面) 3.自动刷新重写规则(针对开发人员)// Code for themesadd_action( 'after_switch_theme', 'flush_rewrite_rules' );// Code for pluginsregister_deactivation_hook( __FILE__, 'flush_rewrite_rules' );register_activation_hook( __FILE__, 'myplugin_flush_rewrites' );function myplugin_flush_rewrites() { // call your CPT registration function here (it should also be hooked into 'init') myplugin_custom_post_types_registration(); flush_rewrite_rules();}