Php can';t solve:未定义的函数get_header()
我正在尝试将静态HTML模板转换为WordPress模板。当我尝试加载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
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">
....