<?php
/**
 * @package Home Tutor
 * @subpackage home-tutor
 * @since home-tutor 1.0
 * Setup the WordPress core custom header feature.
 * @uses home_tutor_header_style()
*/

function home_tutor_custom_header_setup() {

	add_theme_support( 'custom-header', apply_filters( 'home_tutor_custom_header_args', array(
		'default-text-color'     => 'fff',
		'header-text' 			 =>	false,
		'width'                  => 1920,
		'height'                 => 300,
		'flex-width'         	=> true,
        'flex-height'        	=> true,
		'wp-head-callback'       => 'home_tutor_header_style',
	) ) );
}

add_action( 'after_setup_theme', 'home_tutor_custom_header_setup' );

if ( ! function_exists( 'home_tutor_header_style' ) ) :

add_action( 'wp_enqueue_scripts', 'home_tutor_header_style' );
function home_tutor_header_style() {
	$home_tutor_header_image = get_header_image() ? get_header_image() : get_template_directory_uri() . '/images/header-image.png';
	$home_tutor_custom_css = "
        .home-tutor-banner-image-box .top-header-img{
			background-image:url('" . esc_url($home_tutor_header_image) . "');
			background-repeat: no-repeat;
	        background-position: center center;
	        background-size: cover !important;
	        height: 300px;
		}";
	   	wp_add_inline_style( 'home-tutor-basic-style', $home_tutor_custom_css );
}
endif;