<!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 7) | !(IE 8)  ]><!-->
<html <?php language_attributes(); ?>>
<?php 

$custom  = photofolio_custom();

?>
<head>
	<meta charset="utf-8">

	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

	<?php if ( ! function_exists( 'has_site_icon' ) || ! has_site_icon() ) { ?>
	
		<?php if($custom['favicon']['url']!=''){ ?>
			<link rel="icon" href="<?php echo esc_url($custom['favicon']['url']); ?>" type="image/x-icon">
		<?php } ?>

	<?php } ?>
  
  <?php if($custom['apple_icon']['url']!=''){ ?>
  <link rel="apple-touch-icon" href="<?php echo esc_url($custom['apple_icon']['url']); ?>" />
  <?php } ?>
  <?php if($custom['apple_icon_57']['url']!=''){ ?>
  <link rel="apple-touch-icon" sizes="57x57" href="<?php echo esc_url($custom['apple_icon_57']['url']); ?>">
  <?php } ?>
  <?php if($custom['apple_icon_72']['url']!=''){ ?>
  <link rel="apple-touch-icon" sizes="72x72" href="<?php echo esc_url($custom['apple_icon_72']['url']); ?>">
  <?php } ?>
  <?php if($custom['apple_icon_114']['url']!=''){ ?>
  <link rel="apple-touch-icon" sizes="114x114" href="<?php echo esc_url($custom['apple_icon_114']['url']); ?>">
  <?php } ?>
	
	<?php wp_head();?>

</head>
<body <?php body_class(); ?>>

	<!-- Container -->
	<div id="container">

		<!-- Header
		    ================================================== -->
		<header class="clearfix">
			<!-- Static navbar -->
			<div class="navbar navbar-default navbar-fixed-top">
				<div class="container-fluid">
					<div class="navbar-header">
						<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
							<span class="icon-bar"></span>
							<span class="icon-bar"></span>
							<span class="icon-bar"></span>
						</button>
						<a class="navbar-brand"  href="<?php echo esc_url(home_url('/')); ?>" title="<?php bloginfo('name'); ?>">
							<?php if($custom['logo']['url']!=''){ ?>
								<img src="<?php echo esc_attr($custom['logo']['url']); ?>" alt="<?php bloginfo('name'); ?>">
							  <?php }else{ ?>
								<?php bloginfo('name'); ?>
							  <?php } ?>
						</a>
					</div>
					<div class="navbar-collapse collapse">
					<?php if($custom['open_menu']!=true){ ?> 
						<a href="#" class="open-menu">
							<span></span>
							<span class="opened"></span>
							<span></span>
						</a>
					<?php } ?>
						<?php if(is_active_sidebar('sidebar-2')){  ?>
						<ul class="nav navbar-nav navbar-right <?php if($custom['open_menu']==true){ ?> active<?php } ?>">
							
							<li class="open-search"><a href="#"><i class="fa fa-search"></i></a></li>
							
						</ul>
						<?php } ?>
						<?php 
							$menu_class = 'nav navbar-nav navbar-right';
							if($custom['open_menu']==true){
								$menu_class .=' active';
							}
							$defaults1= array(
								'theme_location'  => 'primary',
								'menu'            => '',
								'container'       => '',
								'container_class' => '',
								'container_id'    => '',
								'menu_class'      => $menu_class,
								'menu_id'         => '',
								'echo'            => true,
								 'fallback_cb'       => 'wp_bootstrap_navwalker::fallback',
								 'walker'            => new wp_bootstrap_navwalker(),
								'before'          => '',
								'after'           => '',
								'link_before'     => '',
								'link_after'      => '',
								'items_wrap'      => '<ul data-breakpoint="800" id="%1$s" class="%2$s">%3$s</ul>',
								'depth'           => 0,
							);
							if ( has_nav_menu( 'primary' ) ) {
								wp_nav_menu( $defaults1 );
							}
						
						?>
						
					</div>
				</div>
			</div>
		</header>
		<!-- End Header -->

		<!-- content 
			================================================== -->
		<div id="content" <?php if(is_page_template('template-fullwidth_padding.php') or is_singular('portfolio')){ ?> class="with-paddings" <?php } ?>>
