Fatal error: Call to undefined function get_header() in /home/a7053783/public_html/index.php on line 1
Fatal error: Call to undefined开发者_JAVA技巧 function get_header() in /home/a7053783/public_html/index.php on line 1.
How can I fix the error mentioned above?
As probably you are creating your own wordpress theme. I'm so good at wordpress, but do you have header.php
file in the same folder as index.php
in what you call get_header();
?
Because, if you are viewing your index.php
theme-file on the actual homepage..then it is unlikely, that wordpress is missing the function.
Also you must make sure, that your theme's functions.php
file is correctly filed. I cant remember anymore, what were the MOST critical aspects in the function-file. But this may very well be the problem.
You probably want to double check all of your theme-creating-steps using this tutorial. And also let it be noted, that you can get better wordpress related answers from wordpress.stackexchange.com.
Maybe you meant to call the function get_headers()
? get_header()
is not a standard PHP function.
By the way: it is way easier to help you if you include an example of the actual code going wrong.
As this error occurs in line 1 i suppose get_header()
is not avaialbe.
But i recommend you put the code of index.php here.
i believe this is an error in wordpress, try changing the theme, if the error goes, then you can make sure that it is the problem of the theme
Some more code would help.
Regarding only that message I would guess that you either tryed to call get_header()
before including the file that contains the get_header()
function, or that you meant get_headers()
.
It mostly Appear because of get_header() is not checking properly you can do it via simply adding if condition
btw read source :
http://fixmycms.com/fatal-error-call-to-undefined-function-get_header-in-index-php-on-line-1/
I've got the same problem with the latest version (3.8.1 french edition)
It is really weird but it seems to be related with your index.php file in the template. Instead, create a specific file according to the template hierarchy for all the views: front-page.php, page.php, single.php.
Refer to this link for more info about template hierarchy http://codex.wordpress.org/Template_Hierarchy
精彩评论