- サイトデザイン工事中です。ご意見をお寄せください。
- 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細)
関数リファレンス/wp head
提供:WordPress Codex 日本語版
< 関数リファレンス
目次 |
説明
'wp_head' アクションをスタートさせる。テーマテンプレートファイル内の </body> タグ直前で使う(例: header.php や index.php の中)。
使い方
<?php wp_head(); ?>
パラメータ
この関数は変数を受け付けない。
使用例
WordPress Twenty Eleven テーマ 内での例
wp-content/themes/twentyten/header.php:
<?php
...
/* Always have wp_head() just before the closing </head>
* tag of your theme, or you will break many plugins, which
* generally use this hook to add elements to <head> such
* as styles, scripts, and meta tags.
*/
wp_head();
?>
</head>
注意点
- do_action() の 'wp_head' フックを使う。
変更履歴
- 1.2.0 で新規追加。
ソースファイル
wp_head() は wp-includes/general-template.php に含まれる。
関連情報
- Theme Review(必須)
最新英語版: WordPress Codex » Function Reference/wp head (最新版との差分)