自从我在 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
我无法弄清楚get_header()
在所有这些非功能链接的第 11 行如何处理。结果我从谷歌收到了 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');
}