カスタムヘッダーは管理画面からどこかで使う画像を設定できる。
1.function.phpに以下を記述。
<?php // カスタムヘッダー画像を設置する $custom_header_defaults = array( 'default-image' => get_bloginfo('template_url').'/images/wordpress-logo-hoz-rgb_small.png', 'width' => 220, 'height' => 50, 'header-text' => false, //ヘッダー画像上にテキストをかぶせる ); add_theme_support( 'custom-header', $custom_header_defaults ); //カスタムヘッダー機能を有効にする ?>
2.画像を出力
<img src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" alt="" />