URLをコピーしました!
スキルアップを始める!

【WordPress】WordPress動作①ルートのindex.phpについて

WordPress(ワードプレス)
\ワードプレスのスキルアップはこちら!/ WordPress入門読本

① index.php

まず最初に実行されるファイル

テーマの使用チェック後に「wp-blog-header.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' );




  • 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.

WordPressアプリケーションの前面。 このファイルは何もしませんが、wp-blog-header.phpを読み込み、WordPressにテーマをロードするように指示します。

  • Tells WordPress to load the WordPress theme and output it.

WordPressにWordPressテーマを読み込んで出力するよう指示します。

define('WP_USE_THEMES', true);

※PHPのdefine関数では定数を定義することができます。

defineの使い方

define(定数名, 値 [, 大文字と小文字の区別]);

WordPress環境とテンプレートを読み込みます。

require( dirname( FILE ) . '/wp-blog-header.php' );

ご参考ください。

Kindle Unlimited 会員は無料で購読できます
購読はこちら
Kindle Unlimited 会員は無料で購読できます
購読はこちら