<?php
/**
 * @package Visa Consulting Service
 * @subpackage visa-consulting-service
 * @since visa-consulting-service 1.0
 * Setup the WordPress core custom header feature.
 * @uses visa_consulting_service_header_style()
*/

function visa_consulting_service_custom_header_setup() {

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

add_action( 'after_setup_theme', 'visa_consulting_service_custom_header_setup' );

if ( ! function_exists( 'visa_consulting_service_header_style' ) ) :

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