Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/260.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php can';t solve:未定义的函数get_header()_Php_Wordpress_Header_Wordpress Theming - Fatal编程技术网

Php can';t solve:未定义的函数get_header()

Php can';t solve:未定义的函数get_header(),php,wordpress,header,wordpress-theming,Php,Wordpress,Header,Wordpress Theming,我正在尝试将静态HTML模板转换为WordPress模板。当我尝试加载index.php时,我从header.php中得到以下错误: 致命错误:在第1行的C:\xampp\htdocs\site\u name\wp content\themes\template\u name\features.php中调用未定义的函数get\u header() 我一直在寻找解决方案,但没有找到。如果有人能帮我解决这个问题,我会非常感激 注: 我没有修改我的root index.php文件 我有最新版本的Wo

我正在尝试将静态HTML模板转换为WordPress模板。当我尝试加载
index.php
时,我从
header.php
中得到以下错误:

致命错误:在第1行的C:\xampp\htdocs\site\u name\wp content\themes\template\u name\features.php中调用未定义的函数get\u header()

我一直在寻找解决方案,但没有找到。如果有人能帮我解决这个问题,我会非常感激

注:

  • 我没有修改我的root index.php文件
  • 我有最新版本的WordPress 4.3.1
  • 我发现我正在使用的代码直接调用一个文件(例如:features.php),这是我在Wordpress中无法做到的。如果是这样的话,谁能告诉我如何在不调用这个直接调用的情况下调用一个文件
下面是我的
header.php
文件的代码:

<li><a href="<?php bloginfo('template_directory'); ?>/features.php">Features</a></li>

wordpress模板与静态html不同


您可以学习为begginer创建wordpress模板

错误会直接告诉您出了什么问题。在
features.php
的第1行,您正在调用未定义的函数
get_header()
。哪里定义了
get\u header()
?get\u header()是一个内置的wordpress函数。
<?php get_header(); ?>
<div class="container">
<div class="row signin_visitor_you">
<div class="row signin_visitor_you_top">
....