【发布时间】:2016-03-03 19:58:34
【问题描述】:
自从我在 12 月转向多域托管以来,我的网站上出现了错误。有太多的问题,我已经忘记了它们。每天我都会遇到一个令人震惊的新错误,我对此一无所知。
最近的一个无法访问我网站上的作者资料 - http://www.theunbiasedblog.com/author/nikhil
网站的其他部分工作正常,除了以下几点:
-
作者简介(上面提到)这个错误
Fatal error: Call to undefined function get_header() in /home/theun3wr/public_html/author.php on line 11 -
网站上的标记链接 (http://www.theunbiasedblog.com/tag/windows) 出现此错误
Fatal error: Call to undefined function get_header() in /home/theun3wr/public_html/tag.php on line 11 -
网站上的类别链接 (theunbiasedblogcom/category/tech)
Fatal error: Call to undefined function get_header() in /home/theun3wr/public_html/category.php on line 11
我无法弄清楚如何处理所有这些非功能链接的第 11 行上的 get_header()。结果,我收到了来自 google 的 30K 404 错误。
@prakashrao 在 wp-includes/general-template.php 中
我有这个-
/**
* Load header template.
*
* Includes the header template for a theme or if a name is specified then a
* specialised header will be included.
*
* For the parameter, if the file is called "header-special.php" then specify
* "special".
*
* @since 1.5.0
*
* @param string $name The name of the specialised header.
*/
function get_header( $name = null ) {
/**
* Fires before the header template file is loaded.
*
* The hook allows a specific header template file to be used in place of the
* default header template file. If your file is called header-new.php,
* you would specify the filename in the hook as get_header( 'new' ).
*
* @since 2.1.0
* @since 2.8.0 $name parameter added.
*
* @param string $name Name of the specific header file to use.
*/
do_action( 'get_header', $name );
$templates = array();
$name = (string) $name;
if ( '' !== $name )
$templates[] = "header-{$name}.php";
$templates[] = 'header.php';
// Backward compat code will be removed in a future release
if ('' == locate_template($templates, true))
load_template( ABSPATH . WPINC . '/theme-compat/header.php');
}
【问题讨论】:
标签: wordpress get-headers