WordPress テーマ作成フル手順
✅① フォルダ作成
wp-content/themes/mytheme
✅② 最低限必要な 2 ファイルを作る
mytheme/
├─ style.css
└─ index.php
✔ style.css(コピペ OK)
/*
Theme Name: MyTheme
Theme URI: https://example.com/
Author: Your Name
Description: Basic WP Theme
Version: 1.0
*/
✔ index.php(コピペ OK)
テーマが有効化されました!
このページは index.php です
✅ これだけで「外観 → テーマ」から有効化できる
✅③ header.php と footer.php を追加
mytheme/
├─ style.css
├─ index.php
├─ header.php
└─ footer.php
✔ header.php
> >✔ footer.php
©
✅④ functions.php 追加(CSS 読み込み)
mytheme/
├─ style.css
├─ index.php
├─ header.php
├─ footer.php
└─ functions.php
✔ functions.php
フロントページ
',''); the_content(); endwhile; endif; ?>設定 → 表示設定 → ホームページの表示 → 固定ページに変更
✅ フロントページ専用レイアウト成功
✅⑥ 投稿一覧ページ:home.php
最新の投稿
<?php if ( has_post_thumbnail() ) : ?>
<?php the_post_thumbnail('medium'); ?>
<?php endif; ?>
<p><?php the_excerpt(); ?></p>
✅⑦ 単一記事ページ:single.php
✅ここまでで WordPress テーマ完成 🎉
✅オプション(すぐできる)
追加内容 設置ファイル
メニュー機能 functions.php
アイキャッチ有効化 functions.php
ウィジェット機能 functions.php
CSSデザイン強化 style.css