<?php
/**
 * Sample implementation of the Custom Header feature
 * http://codex.wordpress.org/Custom_Headers
 */

if( ! function_exists( 'inspirelite_custom_header_setup' ) ){
	
	function inspirelite_custom_header_setup() {
		add_theme_support( 'custom-header', apply_filters( 'inspirelite_custom_header_args', array(
			'default-image'          => '',
			'default-text-color'     => 'ffffff',
			'width'                  => 1980,
			'height'                 => 300,
			'flex-height'            => true,
			'wp-head-callback'       => 'inspirelite_custom_header_style',
			'admin-head-callback'    => 'inspirelite_admin_header_style',
			'admin-preview-callback' => 'inspirelite_admin_header_image',
		) ) );
	}
	add_action( 'after_setup_theme', 'inspirelite_custom_header_setup' );
}


if ( ! function_exists( 'inspirelite_custom_header_style' ) ) :
/**
 * Styles the header image and text displayed on the blog
 *
 * @see inspirelite_custom_header_setup().
 */
function inspirelite_custom_header_style() {
	
	$header_text_color = get_header_textcolor();

	if ( add_theme_support( 'custom-header' ) == $header_text_color ) {
		return;
	}

	// If we get this far, we have custom styles. Let's do this.
	?>
	<style type="text/css">
	<?php
		// Has the text been hidden?
		if ( 'blank' == $header_text_color ) :
	?>
		.easetemplate-site-title,
		.site-description {
			position: absolute;
			clip: rect(1px, 1px, 1px, 1px);
		}

	<?php endif; ?>
	</style>
	<?php
}
endif; // inspirelite_custom_header_style

if ( ! function_exists( 'inspirelite_admin_header_style' ) ) :
/**
 * Styles the header image displayed on the Appearance > Header admin panel.
 *
 * @see inspirelite_custom_header_setup().
 */
function inspirelite_admin_header_style() {
?>
	<style type="text/css">
		.appearance_page_custom-header #headimg {
			border: none;
		}
		#headimg h1,
		#desc {
		}
		#headimg h1 {
		}
		#headimg h1 a {
		}
		#desc {
		}
		#headimg img {
		}
	</style>
<?php
}
endif; // inspirelite_admin_header_style

if ( ! function_exists( 'inspirelite_admin_header_image' ) ) :
/**
 * Custom header image markup displayed on the Appearance > Header admin panel.
 *
 * @see inspirelite_custom_header_setup().
 */
function inspirelite_admin_header_image() {

	if ( get_header_image() ) : ?>
	<img src="<?php header_image(); ?>" width="100%" height="auto" alt="<?php echo esc_attr( get_bloginfo( 'title' ) ); ?>">
	<?php endif;
}
endif; // inspirelite_admin_header_image