LoginSignup
1
1

More than 3 years have passed since last update.

wp_head();とwp_footer();がないとWordPressテーマは機能しない

Posted at

自作したWordPressテーマをサイトにアップデートしても

wp_head();とwp_footer();を決まったところに記載していないと
テーマは動かないです。

wp_head(); 記載場所

まず、これは
</head>の直前に入れる。

index.php
<!DOCTYPE html>
<html lang="ja">
<head>
 <meta charset="utf-8">
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
 <title>サイトタイトル</title>
 <?php wp_head(); ?>
</head>

wp_footer(); 記載場所

これは
</body>の直前に入れる。

index.php
<?php wp_footer(); ?>
</body>
</html>

まとめ

最初のうちは、なんでWordPressが動かないのか謎な時ありますが
こういう、決まりの物が抜けてたりします。

以上!!

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1