我正在使用儿童主题和二十三个家长。在我的子主题中创建了一个包含图像的目录。但首先要删除默认的2013主题标题。
/* Add custom headers from my child theme */
add_action( \'after_setup_theme\', \'childtheme_setup\' );
if ( ! function_exists( \'childtheme_setup\' ) ):
function childtheme_setup() {
/* Remove Default Headers */
function dr_remove_twenty_thirteen_headers(){
unregister_default_headers( array(
\'star\',
\'diamond\',
\'circle\'
)
);
}
add_action( \'after_setup_theme\', \'dr_remove_twenty_thirteen_headers\', 11 );
// Add our headers
register_default_headers( array(
\'header1\' => array(
\'url\' => get_stylesheet_directory_uri() . \'/images/headers/target_head2.jpg\',
//\'thumbnail_url\' => \'%s/images/headers/circle-thumbnail.png\',
\'description\' => _x( \'header1\', \'header image description\', \'twentythirteen\' )
),
\'header2\' => array(
\'url\' => get_stylesheet_directory_uri() . \'/images/headers/target_head1.jpg\',
//\'thumbnail_url\' => \'%s/images/headers/diamond-thumbnail.png\',
\'description\' => _x( \'header2\', \'header image description\', \'twentythirteen\' )
),
\'header3\' => array(
\'url\' => get_stylesheet_directory_uri() . \'/images/headers/target_head0.jpg\',
//\'thumbnail_url\' => \'%s/images/headers/star-thumbnail.png\',
\'description\' => _x( \'header3\', \'header image description\', \'twentythirteen\' )
)
) );
}
endif;
这适用于我的wp 3.6。您可以添加更多图像。我有9个:)