的错误是:
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
文件夹中。
非常感谢你,我的朋友! – 2014-09-23 22:55:39
@RodrigoLacerda,不客气:-) – 2014-09-24 18:19:13
@RodrigoLacerda如果他们回答你的问题,请接受答案。 – Bjorn 2015-01-04 17:32:56