<?php
/**
 * The header for our theme
 *
 * This is the template that displays all of the <head> section and everything up until <div id="content">
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package megapress
 */

?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="profile" href="https://gmpg.org/xfn/11">

	<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
	<?php do_action( 'wp_body_open' ); ?>
	<div id="page" class="site">
		<a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'megapress' ) ?></a>

		<header id="masthead" class="site-header">
			<?php $header_image = get_header_image_tag();
			if($header_image):
			 ?>
			<div class="header-image">
				<?php echo $header_image; ?>
			</div>
			<?php endif; ?>
			<div class="site-header-top">
				<div class="container">
					<div class="row align-items-center">
						<div class="col-12 col-sm-12 col-md-3">

							<?php dynamic_sidebar('header-widget-left'); ?>
							
						</div>
						<div class="col-12 col-sm-12 col-md-6 text-center">
							<div class="site-branding">
								<?php
								the_custom_logo();
								?>

								<div class="site-identity">
									<?php
									if ( is_front_page() && is_home() ) :
										?>
									<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
									<?php
								else :
									?>
									<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
									<?php
								endif;
								$megapress_description = get_bloginfo( 'description', 'display' );
								if ( $megapress_description || is_customize_preview() ) :
									?>
									<p class="site-description"><?php echo esc_html($megapress_description) ?></p>
								<?php endif; ?>
							</div><!-- site identity end -->
						</div><!-- .site-branding -->
					</div>
					<div class="col-12 col-sm-12 col-md-3">
						<?php dynamic_sidebar('header-widget-right'); ?><!-- widget-area end -->
					</div>
				</div><!-- row end -->	
			</div><!-- container end -->
		</div><!-- site-header-top end -->
		<nav id="site-navigation" class="main-navigation navbar navbar-expand-md navbar-dark bg-dark nav-center">
			<div class="container">
				<button id="menuToggler" class="navbar-toggler" type="button">
					<span class="navbar-toggler-icon"></span>
					<span class="navbar-toggler-icon"></span>
					<span class="navbar-toggler-icon"></span>
				</button>
				<?php
				wp_nav_menu( array(
					'theme_location'  => 'menu-1',
					'depth'	          => 4,
					'container'       => 'div',
					'container_class' => 'navbar-collapse',
					'container_id'    => 'navbar-collapse-menu',
					'menu_class'      => 'navbar-nav mr-auto',
					'fallback_cb'     => 'WP_Bootstrap_Navwalker::fallback',
					'walker'          => new WP_Bootstrap_Navwalker()
				) );				
				?>
			</div>
		</nav><!-- #site-navigation -->
	</header><!-- #masthead -->

	<!-- Carousel goes here -->
	<?php if(is_front_page()) {
			if( 'static' == get_theme_mod('megapress_banner_type') ) {
				get_template_part('template-parts/header/static'); 
			} elseif( 'slideshow' == get_theme_mod('megapress_banner_type') ) {
				get_template_part('template-parts/header/slider'); 
			} 
		 } 
	?>
	<!-- /Carousel goes here -->

	<div id="content" class="site-content">
		<div class="container">
			<div class="row">
