开发者

WordPress call to undefined function get_header();

开发者 https://www.devze.com 2023-03-03 23:50 出处:网络
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.

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. 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

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!" 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.

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.


get_header()
is not a PHP function and thats why it is throwing Fatal error: Call to undefined function

get_header()
is a wordpress function - have you loaded the wordpress function prior to running this function - this is usually done with an include?

0

精彩评论

暂无评论...
验证码 换一张
取 消