简体   繁体   English

WordPress调用未定义的函数get_header();

[英]WordPress call to undefined function get_header();

Firstly, I have looked for previous posts about this topic, but none have the answer that I need. 首先,我寻找过有关该主题的以前的文章,但是没有一个我需要的答案。 So I shall rephrase to fit my problem best. 因此,我将重新表述以最好地解决我的问题。

I'm taking my first crack at creating a very basic WordPress theme. 我正在努力创建一个非常基本的WordPress主题。 I've got all the template files that I want, and while checking my files for errors, I see that I'm getting an error for every file. 我已经有了所需的所有模板文件,并且在检查文件中是否有错误的同时,我发现每个文件都出现错误。

Fatal error: Call to undefined function get_header() in blah/blah/blah.....etc 致命错误:在blah / blah / blah中调用未定义的函数get_header().. etc

I've seen many posts where people simply say "FTP a clean install" or "You moron, you changed the index.php file in the root directory!" 我见过很多帖子,人们只是简单地说“ FTP全新安装”或“您该死,您已更改了根目录中的index.php文件!” The answer is no, this function is called in and only in my theme directory. 答案是否定的,仅在我的主题目录中才调用此函数。

Any help would be HUGELY appreciated! 任何帮助将不胜感激!

Thank you. 谢谢。

Generally this happens when someone has mistakenly put index.php from a theme in the WP install folder, where it overwrites the index.php that is the main WordPress file. 通常,当有人错误地将主题中的index.php放到WP安装文件夹中时,就会覆盖它,它会覆盖WordPress的主要文件index.php。

That is, the index.php that lives in the root directory (thats the directory with the wp-config.php in it) is NOT an editable theme file. 也就是说,位于根目录(即其中包含wp-config.php的目录)中的index.php不是可编辑的主题文件。

get_header()
is not a PHP function and thats why it is throwing Fatal error: Call to undefined function 不是PHP函数,这就是为什么它引发致命错误:调用未定义函数

 get_header() get_header() 
is a wordpress function - have you loaded the wordpress function prior to running this function - this is usually done with an include? 是一个wordpress函数-在运行此函数之前是否已加载wordpress函数-通常是通过include完成的?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM