get_template_directory_uri() . '/images/headers/ginko.jpg', 'default-text-color' => '009BC2', 'width' => 1102, 'height' => 350, 'flex-height' => true, 'wp-head-callback' => 'yoko_header_style', 'admin-head-callback' => 'yoko_admin_header_style', 'admin-preview-callback' => 'yoko_admin_header_image', ) ) ); // We'll be using post thumbnails for custom header images on posts and pages. // We want them to be 940 pixels wide by 350 pixels tall. // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. set_post_thumbnail_size( get_custom_header()->width, get_custom_header()->height, true ); // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. register_default_headers( array( 'ginko' => array( 'url' => '%s/images/headers/ginko.jpg', 'thumbnail_url' => '%s/images/headers/ginko-thumbnail.jpg', 'description' => __( 'Ginko', 'yoko' ) ), 'flowers' => array( 'url' => '%s/images/headers/flowers.jpg', 'thumbnail_url' => '%s/images/headers/flowers-thumbnail.jpg', 'description' => __( 'Flowers', 'yoko' ) ), 'plant' => array( 'url' => '%s/images/headers/plant.jpg', 'thumbnail_url' => '%s/images/headers/plant-thumbnail.jpg', 'description' => __( 'Plant', 'yoko' ) ), 'sailing' => array( 'url' => '%s/images/headers/sailing.jpg', 'thumbnail_url' => '%s/images/headers/sailing-thumbnail.jpg', 'description' => __( 'Sailing', 'yoko' ) ), 'cape' => array( 'url' => '%s/images/headers/cape.jpg', 'thumbnail_url' => '%s/images/headers/cape-thumbnail.jpg', 'description' => __( 'Cape', 'yoko' ) ), 'seagull' => array( 'url' => '%s/images/headers/seagull.jpg', 'thumbnail_url' => '%s/images/headers/seagull-thumbnail.jpg', 'description' => __( 'Seagull', 'yoko' ) ) ) ); } add_action( 'after_setup_theme', 'yoko_custom_header_setup' ); if ( ! function_exists( 'yoko_header_style' ) ) : /** * Styles the header image and text displayed on the blog * * @see yoko_custom_header_setup(). */ function yoko_header_style() { $header_text_color = get_header_textcolor(); // If no custom options for text are set, let's bail // get_header_textcolor() options: HEADER_TEXTCOLOR is default, hide text (returns 'blank') or any hex value if ( HEADER_TEXTCOLOR == $header_text_color ) return; // If we get this far, we have custom styles. Let's do this. ?> Header admin panel. * * @see yoko_custom_header_setup(). */ function yoko_admin_header_style() { ?> Header admin panel. * * @see yoko_custom_header_setup(). */ function yoko_admin_header_image() { $style = sprintf( ' style="color:#%s;"', get_header_textcolor() ); $header_image = get_header_image(); ?>