Fatal error: Uncaught Error: Call to undefined function get_header()

三好酋长在把网站的配置文件 ***.conf 中的 404 页面修改为主题自带的 404.php 之后,在测试访问 404.php 时,竟然显示错误:

Fatal error: Uncaught Error: Call to undefined function get_header() in /404.php:1 Stack trace: #0 {main} thrown in /404.php on line 1

一番折腾既没有找到原因,更没有解决问题。

于是尝试又在配置文件 ***.conf 中注释了定义 404 页面的代码:

# error_page 404 /404.php;

结果正能够正常显示主题的 404 页面了。

看来应该是服务器配置文件定义的 404 页面与主题定义的 404 页面冲突导致的。

You may also like...

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注