
テンプレートの優先度-WordPress
WordPressには各ページ専用のテンプレートファイルが決められています。また優先度があり優先度の高いテンプレートがある場合は、そちらを使用して表示します。
トップページ
管理画面「設定」>「表示設定」:フロントページの表示「最新の投稿」選択時
優先度(高い ← → 低い) |
||
front-page.php |
home.php |
index.php |
管理画面「設定」>「表示設定」:フロントページの表示「固定ページ」選択時
フロントページ
優先度(高い ← → 低い) |
||
front-page.php |
page.php |
index.php |
投稿ページ
優先度(高い ← → 低い) |
|
home.php |
index.php |
固定ページ
優先度(高い ← → 低い) |
||||
ページ名.php |
page-スラッグ.php |
page-ページID.php |
page.php |
index.php |
投稿一覧
優先度(高い ← → 低い) |
|
home.php |
index.php |
投稿詳細
優先度(高い ← → 低い) |
||
single-投稿タイプ.php |
single.php |
index.php |
アーカイブ
優先度(高い ← → 低い) |
||
archive-投稿タイプ.php |
archive.php |
index.php |
カテゴリー別アーカイブ
優先度(高い ← → 低い) |
||||
category-スラッグ.php |
category-カテゴリーID.php |
category.php |
archive.php |
index.php |
タグ別アーカイブ
優先度(高い ← → 低い) |
||||
tag-スラッグ.php |
tag-タグID.php |
tag.php |
archive.php |
index.php |
日付・時間別アーカイブ
優先度(高い ← → 低い) |
||
date.php |
archive.php |
index.php |
著者別アーカイブ
優先度(高い ← → 低い) |
||||
author-名前.php |
author-著者ID.php |
author.php |
archive.php |
index.php |
検索結果
優先度(高い ← → 低い) |
|
search.php |
index.php |
エラーページ(404)
優先度(高い ← → 低い) |
|
404.php |
index.php |