<?php
/**
 * Sample implementation of the Custom Header feature
 *
 * @link https://developer.wordpress.org/themes/functionality/custom-headers/
 *
 * @package wheel_alignment_service
 */

function wheel_alignment_service_custom_header_setup() {
	add_theme_support( 'custom-header', apply_filters( 'wheel_alignment_service_custom_header_args', array(
		'default-text-color'     => 'fff',
		'header-text' 			 =>	false,
		'width'                  => 1360,
		'height'                 => 110,
		'flex-width'         	=> true,
        'flex-height'        	=> true,
		'wp-head-callback'       => 'wheel_alignment_service_header_style',
	) ) );
}

add_action( 'after_setup_theme', 'wheel_alignment_service_custom_header_setup' );

if ( ! function_exists( 'wheel_alignment_service_header_style' ) ) :

	add_action( 'wp_enqueue_scripts', 'wheel_alignment_service_header_style' );
	function wheel_alignment_service_header_style() {
		if ( get_header_image() ) :
		$wheel_alignment_service_custom_css = "
			.header-main-wrapper,.home .bottom-header-outer-wrapper{
				background-image:url('".esc_url(get_header_image())."') !important;
				background-size: 100%;
				background-position: center top;
			}";
			   wp_add_inline_style( 'wheel-alignment-service-style', $wheel_alignment_service_custom_css );
		endif;
	}
endif;