1

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.

2
  • 1
    @Coery Megown Have you "FTP'd a clean install"? Commented May 6, 2011 at 15:41
  • please click the checkbox if one of these answers was helpful. Commented Jun 13, 2011 at 1:15

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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?

2 Comments

what do you mean by "the wordpress function"?
@Corey The only files for the theme should be in wordpress\wp-content\themes\name\ - there should be no other files that you are editing in wordpress - basically something is overwriting the wordpress core functionality - get_header() is located in wp-includes/general-template.php - This file cant be being loaded