'%s/images/headers/books.jpg', 'default-text-color' => '000', 'width' => apply_filters( 'pilcrow_header_image_width', 990 ), 'height' => apply_filters( 'pilcrow_header_image_height', 257 ), 'wp-head-callback' => 'pilcrow_header_style', 'admin-head-callback' => 'pilcrow_admin_header_style', 'admin-preview-callback' => 'pilcrow_admin_header_image', ); $options = pilcrow_get_theme_options(); if ( in_array( $options['theme_layout'], array( 'content-sidebar', 'sidebar-content' ) ) ) { $args['width'] = apply_filters( 'pilcrow_header_image_width', 770 ); $args['height'] = apply_filters( 'pilcrow_header_image_height', 200 ); } add_theme_support( 'custom-header', apply_filters( 'pilcrow_custom_header_args', $args ) ); // We'll be using post thumbnails for custom header images on posts and pages. // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. set_post_thumbnail_size( $args['width'], $args['height'], true ); // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. register_default_headers( array( 'books' => array( 'url' => '%s/images/headers/books.jpg', 'thumbnail_url' => '%s/images/headers/books-thumbnail.jpg', 'description' => _x( 'Books', 'Header image description', 'pilcrow' ) ), 'record' => array( 'url' => '%s/images/headers/record.jpg', 'thumbnail_url' => '%s/images/headers/record-thumbnail.jpg', 'description' => _x( 'Record', 'Header image description', 'pilcrow' ) ), 'pattern' => array( 'url' => '%s/images/headers/pattern.jpg', 'thumbnail_url' => '%s/images/headers/pattern-thumbnail.jpg', 'description' => _x( 'Pattern', 'Header image description', 'pilcrow' ) ), ) ); } add_action( 'after_setup_theme', 'pilcrow_custom_header_setup' ); if ( ! function_exists( 'pilcrow_header_style' ) ) : /** * Styles the header image and text displayed on the blog * * @see pilcrow_custom_header_setup(). */ function pilcrow_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 pilcrow_custom_header_setup(). */ function pilcrow_admin_header_style() { ?> Header admin panel. * * @see pilcrow_custom_header_setup(). */ function pilcrow_admin_header_image() { $style = sprintf( ' style="color:#%s;"', get_header_textcolor() ); $header_image = get_header_image(); ?>