Header screen. * @type string $admin_preview_callback Callback function used to create the custom header markup in * the Appearance > Header screen. * } */ /* add_theme_support('custom-header', apply_filters('advent_custom_header_args', array( 'default-text-color' => 'fff', 'width' => 1260, 'height' => 240, 'flex-height' => true, 'wp-head-callback' => 'advent_header_style', 'admin-head-callback' => 'advent_admin_header_style', 'admin-preview-callback' => 'advent_admin_header_image', ))); */ $advent_args = array( // Text color and image (empty to use none). 'default-text-color' => '220e10', // Set height and width, with a maximum value for the width. 'height' => 1260, 'width' => 240, // Callbacks for styling the header and the admin preview. 'wp-head-callback' => 'advent_header_style', 'admin-head-callback' => 'advent_admin_header_style', 'admin-preview-callback' => 'advent_admin_header_image', ); add_theme_support( 'custom-header', $advent_args ); /* * Default custom headers packaged with the theme. * %s is a placeholder for the theme template directory URI. */ register_default_headers( array( 'circle' => array( 'url' => '%s/images/headers/home-banner.jpg', 'thumbnail_url' => '%s/images/headers/home-banner-thumbnail.jpg', 'description' => _x( 'Circle', 'header image description', 'advent' ) ), ) ); } add_action('after_setup_theme', 'advent_custom_header_setup'); /** * Loads our special font CSS files. */ function advent_custom_header_fonts() { // Add Open Sans and Bitter fonts. wp_enqueue_style( 'advent-fonts', advent_font_url(), array(), null ); } add_action( 'admin_print_styles-appearance_page_custom-header', 'advent_custom_header_fonts' ); /* * Styles the header text displayed on the blog. */ function advent_header_style() { $advent_header_image = get_header_image(); $advent_text_color = get_header_textcolor(); // If no custom options for text are set, let's bail. if ( empty( $advent_header_image ) && $advent_text_color == get_theme_support( 'custom-header', 'default-text-color' ) ) return; // If we get this far, we have custom styles. ?> Header admin panel. */ function advent_admin_header_style() { $advent_header_image = get_header_image(); ?> Header admin panel. */ function advent_admin_header_image() { ?>