WP階層で間違ったindex.phpファイルを表示しようとしているため、エラーが発生します。テーマのフォルダーにあるindex.phpは、WP環境のすべての機能をロードすることを目的としたものではありません。
ドキュメントルートで最上位のindex.phpファイルを開きます。(wp-admin、wp-content、およびwp-includesフォルダーと同じディレクトリにあるindex.phpファイル。)このファイルは、Web経由でサイトにアクセスするときにブラウザー(またはDWライブビュー)に表示されるすべてのものを処理します。 url。
/ wp-content / themes / YOUR-THEMEにあるテーマのファイルを編集して、テーマを変更できます。
変更を加えたら、最上位のindex.phpファイルをプレビューして変更を表示できます。
DWプレビューを介してサイトを表示するために使用する必要がある正しいindex.phpファイルには、デフォルトで次のコードのみが含まれている必要があります。
<?php
/**
* 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' );