0

12 月にマルチドメイン ホスティングに移行して以来、ウェブサイトのエラーに悩まされています。あまりにも多くの問題があり、私はそれらを見失いました。そして、私は毎日、私が無知な衝撃的な新しいエラーに遭遇します.

私のウェブサイトの著者プロフィールにアクセスできない最新のものの1つ - http://www.theunbiasedblog.com/author/nikhil

ウェブサイトの残りの部分は、次のことを除いて問題なく機能しています。

  1. 著者プロファイル (上記) このエラー

    Fatal error: Call to undefined function get_header() in /home/theun3wr/public_html/author.php on line 11
    
  2. サイトのタグ リンク ( http://www.theunbiasedblog.com/tag/windows ) でこのエラーが発生する

    Fatal error: Call to undefined function get_header() in /home/theun3wr/public_html/tag.php on line 11
    
  3. サイトのカテゴリ リンク (theunbiasedblogcom/category/tech)

    Fatal error: Call to undefined function get_header() in /home/theun3wr/public_html/category.php on line 11
    

get_header()これらすべての機能しないリンクの 11 行目にあるものをどうするかわかりません。その結果、Google から 30,000 の 404 エラーが発生しました。

@prakashrao in 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');
 }
4

1 に答える 1

0

ここに画像の説明を入力アクティブなテーマでこの関数が定義されていることを確認してください

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');
}
于 2016-03-03T20:11:31.770 に答える