在中添加以下代码functions.php
主题的文件。它将告诉您的主题支持自定义标题:
$defaults = array(
\'default-image\' => \'\',
\'width\' => 0,
\'height\' => 0,
\'flex-height\' => false,
\'flex-width\' => false,
\'uploads\' => true,
\'random-default\' => false,
\'header-text\' => true,
\'default-text-color\' => \'\',
\'wp-head-callback\' => \'\',
\'admin-head-callback\' => \'\',
\'admin-preview-callback\' => \'\',
);
add_theme_support( \'custom-header\', $defaults );
将此添加到
Header.php
主题文件:
<img src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" alt="" />
Recommended : Custom Headers .