<?php
/**
* Template Name: Header Two
*
*/
?>
<header id="masthead" class="site-header header-one" style="background-image: url(<?php echo esc_url( get_header_image() ); ?>);">
	<?php
	$top_header_phone = get_theme_mod('top_header_phone', esc_html__( '+1 763-227-5032', 'digital-marketing-blog' ));
	$top_header_email = get_theme_mod('top_header_email', esc_html__( 'your@test.com', 'digital-marketing-blog' ));
	$top_header_phone_link = preg_replace( '/[^0-9+]/', '', $top_header_phone );
	$top_header_email_link = sanitize_email( $top_header_email );

	if(get_theme_mod('top_header_on_off', 'on')):
	?>
	<div class="top-header">
		<div class="container">
			<div class="row">
				<div class="col-md-6 align-self-center top-header-col">
					<div class="search-menu__wrapper">
						<?php
							$digital_marketing_blog_description = get_bloginfo( 'description', 'display' );
							if ( $digital_marketing_blog_description || is_customize_preview() ) :
								?>
									<p class="site-description"><?php echo esc_html( $digital_marketing_blog_description ); /* WPCS: xss ok. */ ?></p>
								<?php
							endif;
						?>
						<!-- <?php if ( class_exists( 'WooCommerce' ) ) { ?>
						<div class="woocommerce__col">
							<a href="/my-account/"><i class="fa fa-user-o"></i></a>
						</div>
						<?php } ?>
						<form class="search-form" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>">
							<input type="text" class="form-control" id="search" placeholder="<?php esc_attr_e( 'Search Here.....', 'digital-marketing-blog' ); ?>" value="<?php echo esc_attr( get_search_query() ); ?>" name="s">
							<button type="submit"><i class="fa fa-search" aria-hidden="true"></i></button>
						</form> -->
					</div>
				</div>
				<div class="col-md-6 m-auto align-self-center text-right">
					<ul>
							<li><a href="tel:<?php echo esc_attr( $top_header_phone_link ); ?>"><i class="fa fa-phone"></i> <span><?php echo esc_html( $top_header_phone ); ?></span></a></li>
							<li><a href="mailto:<?php echo esc_attr( $top_header_email_link ); ?>"><i class="fa fa-envelope"></i> <span><?php echo esc_html( $top_header_email ); ?></span></a></li>
						</ul>
				</div>
			</div>
		</div>
	</div>
	<?php endif; ?>
	<div class="main-header">
		<div class="container">
			<div class="row header-branding">
				<div class="col-md-4 align-self-center branding-col">
					<div class="site-branding header-logo">
						<?php
						if ( has_custom_logo() ) :
							the_custom_logo();
						endif;
						?>
						<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
					</div><!-- .site-branding -->
				</div>
				<div class="col-md-8 m-auto align-self-center text-center">
					<div class="cssmenu-center text-center" id="cssmenu">
						<?php
						wp_nav_menu(
							array(
								'theme_location'    => 'main-menu',
								'container'         => 'ul',
							)
						);
						?>
					</div>
				</div>
			</div>
		</div>
	</div>
</header><!-- #masthead -->
