*
* @package Bookmark
*/
/**
* Set up the WordPress core custom header feature.
*
* @uses bookmark_header_style()
*/
function bookmark_custom_header_setup() {
add_theme_support( 'custom-header', apply_filters( 'bookmark_custom_header_args', array(
'default-image' => get_template_directory_uri() . '/assets/images/default-header.jpg',
'default-text-color' => 'ffffff',
'width' => 1500,
'height' => 300,
'flex-height' => true,
'wp-head-callback' => 'bookmark_header_style',
) ) );
}
add_action( 'after_setup_theme', 'bookmark_custom_header_setup' );
if ( ! function_exists( 'bookmark_header_image' ) ) :
/**
* Display the custom header image.
*/
function bookmark_header_image() {
if ( ! get_header_image() ) {
return;
}
$header_image = get_header_image();
echo 'style="background-image: url(' . esc_url( $header_image ) . ');"';
}
endif; // bookmark_header_image
if ( ! function_exists( 'bookmark_header_style' ) ) :
/**
* Styles the header image and text displayed on the blog
*
* @see bookmark_custom_header_setup().
*/
function bookmark_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.
?>