<?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 Super_Blog
 */

?><!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="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">

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

<body <?php body_class(); ?>>
	<?php if ( function_exists( 'wp_body_open' ) ) {
        wp_body_open();
    } else { 
    	do_action( 'wp_body_open' ); 
    } ?>
<div id="page" class="site">
	<?php 
	$sticky = get_theme_mod('sticky', 0);

	$sticky_class = (1 !== $sticky ) ? 'navbar-fixed-top' : '';
	?>
	<header id="masthead" class="site-header <?php echo esc_attr( $sticky_class ); ?>" role="banner">
		<div class="container">
			<div class="row">
				<div class="col-sm-3">
					<div class="site-branding">
						<?php
						if ( has_custom_logo() ) {

							the_custom_logo();

						} else{ ?>

								<h1 class="main-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>										
						<?php } ?>
					</div><!-- .site-branding -->
				</div>

				<div class="col-sm-9 menu-navigation">
					<nav id="site-navigation" class="main-navigation" role="navigation">
						
						<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_id' => 'primary-menu', 'fallback_cb' => 'super_blog_menu_fallback' ) ); ?>
					</nav><!-- #site-navigation -->	                  
				</div>
			</div>
		</div>

	</header><!-- #masthead -->

	<?php 

	$banner_type = get_theme_mod('banner_type', 'image');

	if( 'disable' !== $banner_type && (is_home() || is_front_page()) ){

		if( 'slider' === $banner_type ){ 

			$slider_shortcode = get_theme_mod('metaslider');

			if( !empty( $slider_shortcode ) ){ ?>

				<div class="main-slider">
					<?php echo do_shortcode( esc_html( $slider_shortcode )); ?>
				</div>

				<?php 

			} else{ ?>
				<p class="no-slider"><?php printf( esc_html__( 'Please, enter Metaslider shortcode.', 'super-blog') );?><p>
				<?php
			}

		} elseif( 'image' === $banner_type  ){

			$header_image = get_header_image();

			if( !empty( $header_image ) ){ ?>
			
				<div class="main-banner" style='background-image: url(<?php echo esc_url($header_image); ?>);'>
					<div class="container">
						<div class="row">							
							<div class="site-title banner-title">
								<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
							</div>

							<?php
							$description = get_bloginfo( 'description', 'display' );
							if ( $description || is_customize_preview() ) : ?>
								<p class="site-description"><?php echo $description; ?></p>
							<?php
							endif; ?>
							
						</div>
					</div>					
				</div><!-- .main-banner -->

				<?php 
			}	 

		}

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

			<?php	
			/**
			 * Breadcrumb action hook
			 *
			 *
			 */
			do_action('superblog_action_after_header'); ?>
			