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

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

add_action( 'after_setup_theme', 'jeweler_shop_custom_header_setup' );

if ( ! function_exists( 'jeweler_shop_header_style' ) ) :

add_action( 'wp_enqueue_scripts', 'jeweler_shop_header_style' );
function jeweler_shop_header_style() {
	if ( get_header_image() ) :
	$jeweler_shop_custom_css = "
            .bottom-header-outer-wrapper, header.site-header .header-main-wrapper .bottom-header-outer-wrapper .bottom-header-part, header.site-header .header-main-wrapper .bottom-header-outer-wrapper .bottom-header-part .bottom-header-part-wrapper.hello.sticky-header.is-sticky {
			background-image:url('".esc_url(get_header_image())."') !important;
			background-position: center top;
			background-size: cover !important;
		}";
	   	wp_add_inline_style( 'jeweler-shop-style', $jeweler_shop_custom_css );
	endif;
}
endif;