2014-09-22 191 views
0

我刚刚购买了一个wordpress模板,并且试图在本地运行此主题(xampp),并且那么当网站负载,它给了我下面的错误:致命错误:调用未定义的函数get_header()在第13行C: xampp htdocs hypershot index.php

- >致命错误:调用在C未定义功能get_header():\ XAMPP \ htdocs中\ hypershot \的index.php上线13

我想知道如何进行...任何提示?

ps。我现在真的很伤心,因为我认为这将很容易处理这个模板/主题! 我只是不能运行该网站(本地)。

回答

4

的错误是:

Fatal error: Call to undefined function get_header() in C:\xampp\htdocs\hypershot\index.php 

根据WordPress文件夹结构index.php文件在你的项目的根应该是这样的(Version - 4.0):

/** 
* Front to the WordPress application. This file doesn't do anything, but loads 
* wp-blog-header.php which does and tells WordPress to load the theme. 
* 
* @package WordPress 
*/ 

/** 
* Tells WordPress to load the WordPress theme and output it. 
* 
* @var bool 
*/ 
define('WP_USE_THEMES', true); 

/** Loads the WordPress Environment and Template */ 
require(dirname(__FILE__) . '/wp-blog-header.php'); 

但错误说,你有一个index.php文件,里面有get_header()函数(WordPress函数),所以这个index.php文件属于你的的根目录文件夹不在您的项目文件夹的根目录中。

由于get_header()WordPress功能和WordPress未加载却又如此PHP引发此错误,因为它不承认get_header()功能。因此,请检查项目根目录中的index.php文件,并确保右边的index.php文件在那里。

解决此问题的最佳方法是,重新安装WordPress的新副本,然后将主题放入您的C:\xampp\htdocs\hypershot\wp-content\themes文件夹中。

+1

非常感谢你,我的朋友! – 2014-09-23 22:55:39

+0

@RodrigoLacerda,不客气:-) – 2014-09-24 18:19:13

+1

@RodrigoLacerda如果他们回答你的问题,请接受答案。 – Bjorn 2015-01-04 17:32:56

相关问题