2015-09-27 50 views
-1

我想将静态HTML模板转换为WordPress模板。当我尝试加载index.php,我从header.php出现以下错误:无法解决:未定义函数get_header()

Fatal error: Call to undefined function get_header()in C:\xampp\htdocs\site_name\wp-content\themes\template_name\features.php on line 1

我搜索的解决方案,但一个也没找到。如果有人能帮我解决这个问题,我会非常感激。

NB:

  • 我没有修改我的根index.php文件
  • 我已经得到了最新版的WordPress 4.3.1
  • 我发现我的代码” m直接调用一个文件(例如:features.php),这是我在Wordpress中无法做到的。如果是这样,任何人都可以告诉我如何调用一个文件而不用调用这个直接调用。

这里是我的header.php文件的代码:

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

这里是features.php文件

<?php get_header(); ?> 
<div class="container"> 
<div class="row signin_visitor_you"> 
<div class="row signin_visitor_you_top"> 
.... 
+1

错误字面上告诉你什么是错的。在'features.php'的第一行,你正在调用未定义的函数'get_header()'。 'get_header()'定义在哪里? – mittmemo

+0

** get_header()**是一个内置的wordpress函数。 – user2263419

回答

0

WordPress的模板是静态的HTML不同

你可以学会制造wordpress template for begginer here

相关问题