'111', 'default-image' => '', // Set height and width, with a maximum value for the width. 'height' => 500, 'width' => 1440, // Support flexible height and width. 'flex-height' => false, 'flex-width' => false, // Random image rotation off by default. 'random-default' => false, // Callbacks for styling the header and the admin preview. 'wp-head-callback' => 'book_header_style', 'admin-head-callback' => 'book_admin_header_style', 'admin-preview-callback' => 'book_admin_header_image', ); add_theme_support( 'custom-header', $args ); } add_action( 'after_setup_theme', 'book_custom_header_setup' ); // Add specific CSS class by filter add_filter( 'body_class', 'book_custom_header_class' ); function book_custom_header_class( $classes ) { if( ( is_home() && get_header_image() ) || ( is_single() && has_post_thumbnail() ) ) { $classes[] = 'custom-header'; } else { $classes[] = 'no-custom-header'; } if( ! is_home() ) { $classes[] = 'no-home'; } return $classes; } /** * Styles the header text displayed on the blog. * */ function book_header_style() { $text_color = get_header_textcolor(); global $content_width; // If we get this far, we have custom styles. ?> Header admin panel. * */ function book_admin_header_style() { $header_image = get_header_image(); global $content_width; ?> Header admin panel. * */ function book_admin_header_image() { ?>