*
* @link https://developer.wordpress.org/themes/functionality/custom-headers/
*
* @package Blog_Lite
*/
/**
* Set up the WordPress core custom header feature.
*
* @uses blog_lite_header_style()
*/
function blog_lite_custom_header_setup() {
add_theme_support( 'custom-header', apply_filters( 'blog_lite_custom_header_args', array(
'default-image' => '',
'default-text-color' => '000000',
'width' => 1600,
'height' => 270,
'flex-height' => true,
'wp-head-callback' => 'blog_lite_header_style',
'default-image' => '%s/assets/images/headers/small-boy.jpg',
) ) );
/*
* Default custom headers packaged with the theme.
* %s is a placeholder for the theme template directory URI.
*/
register_default_headers( array(
'small-boy' => array(
'url' => '%s/assets/images/headers/small-boy.jpg',
'thumbnail_url' => '%s/assets/images/headers/small-boy-thumbnail.jpg',
'description' => _x( 'small-boy', 'small-boy for default banner', 'blog-lite' )
),
'notebook' => array(
'url' => '%s/assets/images/headers/notebook.jpg',
'thumbnail_url' => '%s/assets/images/headers/notebook-thumbnail.jpg',
'description' => _x( 'notebook', 'header image description', 'blog-lite' )
),
'computer-cup' => array(
'url' => '%s/assets/images/headers/computer-cup.jpg',
'thumbnail_url' => '%s/assets/images/headers/computer-cup-thumbnail.jpg',
'description' => _x( 'computer-cup', 'header image description', 'blog-lite' )
),
) );
}
add_action( 'after_setup_theme', 'blog_lite_custom_header_setup' );
if ( ! function_exists( 'blog_lite_header_style' ) ) :
/**
* Styles the header image and text displayed on the blog.
*
* @see blog_lite_custom_header_setup().
*/
function blog_lite_header_style() {
$header_text_color = get_header_textcolor();
/*
* If no custom options for text are set, let's bail.
* get_header_textcolor() options: Any hex value, 'blank' to hide text. Default: HEADER_TEXTCOLOR.
*/
if ( HEADER_TEXTCOLOR === $header_text_color ) {
return;
}
// If we get this far, we have custom styles. Let's do this.
?>