get_template_directory_uri() . '/images/header.jpg', 'default-text-color' => 'ffffff', 'width' => 1280, 'height' => 426, 'flex-height' => true, 'wp-head-callback' => 'hemingway_rewritten_header_style', 'admin-head-callback' => 'hemingway_rewritten_admin_header_style', 'admin-preview-callback' => 'hemingway_rewritten_admin_header_image', ) ) ); register_default_headers( array( 'default-image' => array( 'url' => '%s/images/header.jpg', 'thumbnail_url' => '%s/images/header.jpg', 'description' => esc_html__( 'Default Header Image', 'hemingway-rewritten' ), ), ) ); } add_action( 'after_setup_theme', 'hemingway_rewritten_custom_header_setup' ); if ( ! function_exists( 'hemingway_rewritten_header_style' ) ) : /** * Styles the header image and text displayed on the blog * * @see hemingway_rewritten_custom_header_setup(). */ function hemingway_rewritten_header_style() { $header_text_color = get_header_textcolor(); $header_image = get_header_image(); // If no custom options for text or header image 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 && '' == $header_image ) { return; } // If we get this far, we have custom styles. Let's do this. ?> Header admin panel. * * @see hemingway_rewritten_custom_header_setup(). */ function hemingway_rewritten_admin_header_style() { ?> Header admin panel. * * @see hemingway_rewritten_custom_header_setup(). */ function hemingway_rewritten_admin_header_image() { $style = sprintf( ' style="color:#%s;"', get_header_textcolor() ); $image = ''; if ( get_header_image() ) $image = sprintf( ' style="background-image:url(%s);"', get_header_image() ); ?>