致命错误:在第1行的index.php中调用未定义的函数get_header() [英] Fatal error: Call to undefined function get_header() in index.php on line 1
问题描述
我有同样的问题.我对PHP完全陌生.我安装了 XAMPP 并从WordPress下载了填充图案.当我运行index.php时,出现以下错误
I have the same issue. I am totally new in PHP. I installed XAMPP and downloaded the hatch theme from WordPress. When I run index.php it gives me the following error
致命错误:在第1行的C:\ xampp \ htdocs \ hatch \ index.php中调用未定义的函数get_header()"
"Fatal error: Call to undefined function get_header() in C:\xampp\htdocs\hatch\index.php on line 1"
我该如何解决?
推荐答案
您似乎正在尝试在WordPress安装之外运行WordPress主题.
It appears that you're trying to run a WordPress theme outside of an installation of WordPress.
您需要下载 WordPress 的副本,并将其解压缩到您的htdocs
文件夹中(就像您所做的那样)主题),然后在浏览器中导航到该主题.
You need to download a copy of WordPress, extract it into your htdocs
folder (like you did with the theme), and then navigate to it in your browser.
设置完毕(只需按照说明进行操作),您需要将该主题放置在WordPress安装中的wp-content/themes
中.
After setting it up (just follow the instructions), you need to place that theme in wp-content/themes
inside the WordPress install.
然后,您可以在WordPress管理员面板中将主题更改为新主题.
Then, you can change the theme to your new one in your WordPress administrator panel.
这篇关于致命错误:在第1行的index.php中调用未定义的函数get_header()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!