<!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js">
<head>
<meta charset="utf-8">

<?php // force Internet Explorer to use the latest rendering engine available?>
<meta http-equiv="X-UA-Compatible" content="IE=edge">


		<!-- Required meta tags -->

		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

		<title><?php wp_title(''); ?></title>

		<!-- Bootstrap CSS -->
		<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/bootstrap.min.css" >
		<!-- Font -->
		<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/font-awesome.min.css">
		<!-- Slicknav -->
		<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/slicknav.css">
		<!-- Owl carousel -->
		<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/owl.carousel.css">
		<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/owl.theme.css">
		<!-- Animate -->
		<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/animate.css">
		<!-- Main Style -->
		<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/main.css">
		<!-- Extras Style -->
		<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/extras.css">
		<!-- Responsive Style -->
		<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/responsive.css">


		<?php // icons & favicons (for more: http://www.jonathantneal.com/blog/understand-the-favicon/)?>
		<link rel="apple-touch-icon" href="<?php echo get_template_directory_uri(); ?>/library/images/apple-touch-icon.png">
		<link rel="icon" href="<?php echo get_template_directory_uri(); ?>/favicon.png">
		<!--[if IE]>
			<link rel="shortcut icon" href="<?php echo get_template_directory_uri(); ?>/favicon.ico">
		<![endif]-->
		<?php // or, set /favicon.ico for IE10 win?>
		<meta name="msapplication-TileColor" content="#aaa">
		<meta name="msapplication-TileImage" content="<?php echo get_template_directory_uri(); ?>/library/images/win8-tile-icon.png">
						<meta name="theme-color" content="#bbb">

		<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>">

		<?php // wordpress head functions?>
		<?php wp_head(); ?>
		<?php // end of wordpress head?>



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

		<!-- Header Area wrapper Starts -->
		<div data-id="header-wrap" class="header-wrap">
			<!-- Navbar Start -->
			<nav class="navbar navbar-expand-lg fixed-top scrolling-navbar indigo">
				<div class="container">
					<!-- Brand and toggle get grouped for better mobile display -->
					<div class="navbar-header">
						<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#main-navbar" aria-controls="main-navbar" aria-expanded="false" aria-label="Toggle navigation">
							<span class="navbar-toggler-icon"></span>
							<span class="icon-menu"></span>
							<span class="icon-menu"></span>
							<span class="icon-menu"></span>
						</button>
						<a href="<?php echo get_home_url(); ?>/<?php if (  is_front_page()  ) { echo '#sliders'; } else { echo 'index.php'; }  ?>" class="navbar-brand"><img src="<?php echo get_template_directory_uri(); ?>/img/logo.png" alt=""></a>
					</div>
					<div class="collapse navbar-collapse" id="main-navbar">
						<ul class="navbar-nav mr-auto w-100 justify-content-end clearfix">
							<li class="nav-item <?php if (  is_front_page()  ) { echo 'active' ; } ?>">
								<a class="nav-link" href="<?php echo get_home_url(); ?>/<?php if (  is_front_page()  ) { echo '#sliders'; } else { echo 'index.php'; }  ?>">
									Home
								</a>
							</li>
							<li class="nav-item">
								<a class="nav-link" href="<?php echo get_home_url(); ?>/#about">
									Geschäftsfelder
								</a>
							</li>
							<li class="nav-item">
								<a class="nav-link" href="<?php echo get_home_url(); ?>/#portfolio">
									Projekte
								</a>
							</li>
							<li class="nav-item">
								<a class="nav-link" href="<?php echo get_home_url(); ?>/#team-section">
									Team
								</a>
							</li>
							<li class="nav-item">
								<a class="nav-link" href="<?php echo get_home_url(); ?>/#clients">
									Kunden
								</a>
							</li>
							<li class="nav-item">
								<a class="nav-link" href="<?php echo get_home_url(); ?>/#footer">
									Kontakt
								</a>
							</li>

						</ul>
					</div>
				</div>

				<!-- Mobile Menu Start -->
				<ul class="mobile-menu navbar-nav">
					<li>
						<a class="page-scroll" href="<?php echo get_home_url(); ?>/#sliders">
							Home
						</a>
					</li>
					<li>
						<a class="page-scroll" href="<?php echo get_home_url(); ?>/#about">
							Geschäftsfelder
						</a>
					</li>
					<li>
						<a class="page-scroll" href="<?php echo get_home_url(); ?>/#portfolio">
							Projekte
						</a>
					</li>
					<li>
						<a class="page-scroll" href="<?php echo get_home_url(); ?>/#team-section">
							Team
						</a>
					</li>
					<li>
						<a class="page-scroll" href="<?php echo get_home_url(); ?>/#baugruppen">
							Baugruppen
						</a>
					</li>
					<li>
						<a class="page-scroll" href="<?php echo get_home_url(); ?>/#clients">
							Kunden
						</a>
					</li>
					<li>
						<a class="page-scroll" href="<?php echo get_home_url(); ?>/#footer">
							Kontakt
						</a>
					</li>

				</ul>
				<!-- Mobile Menu End -->

			</nav>
			<!-- Navbar End -->

		</div>
		<!-- Header Area wrapper End -->


		<?php if (is_front_page()): ?>

		<!-- sliders -->
		<div id="sliders">
			<div class="full-width">
				<!-- light slider -->
				<div id="light-slider" class="carousel slide">
					<div id="carousel-area">
						<div id="carousel-slider" class="carousel slide" data-ride="carousel">
							<ol class="carousel-indicators">


								<?php

									$args = array(
											'post_type' => 'slides',
											'post_status' => 'publish',
											'posts_per_page' => -1
									);
									$posts = new WP_Query($args);
									$counter = 0;

									while ($posts -> have_posts()) {
											$posts->the_post(); ?>

											<li data-target="#carousel-slider" data-slide-to="<?php echo $counter; ?>" <?php if ( $counter == 0 ) { echo 'class="active"'; } ?> ></li>

											<!--
								<li data-target="#carousel-slider" data-slide-to="0" class="active"></li>
								<li data-target="#carousel-slider" data-slide-to="1"></li>
								<li data-target="#carousel-slider" data-slide-to="2"></li>


	-->

							 <?php
							 $counter ++ ;
							} //  while ( $posts -> have_posts() )

							 ?>


							</ol>
							<div class="carousel-inner" role="listbox">

												<?php

													$args = array(
															'post_type' => 'slides',
															'post_status' => 'publish',
															'posts_per_page' => -1
													);
													$posts = new WP_Query($args);
													$counter = 1;

													while ($posts -> have_posts()) {
															$posts->the_post(); ?>


															<div class="carousel-item  <?php if ( $counter == 1 ) { echo "active"; } ?>">
																<img src="<?php echo get_the_post_thumbnail_url($posts->post->ID, 'slides_thumb' ); ?>" alt="<?php the_title(); ?>">
																<div class="carousel-caption">
																	<h3 class="slide-title animated fadeInDown"><?php the_title(); ?></h3>
																	<h5 class="slide-text animated fadeIn"><?php echo get_post_meta($posts->post->ID, 'slide_text', true); ?></h5>
																	<!-- <a href="#" class="btn btn-lg btn-common animated fadeInUp">Get Started</a> -->
																	<?php if (  !empty(  get_post_meta($posts->post->ID, 'slide_link', true)  )  ) : ?>
																	<a href="<?php echo get_post_meta($posts->post->ID, 'slide_link', true); ?>" class="btn btn-lg btn-border animated fadeInUp">
																		<?php echo get_post_meta($posts->post->ID, 'slide_link_text', true); ?>
																	</a>
																<?php endif;?>
																</div>
															</div>




														<?php
														$counter ++ ;
													} //  while ( $posts -> have_posts() )

														?>



							<?php if ( $posts->post_count > 1 ) : ?>
							<a class="carousel-control-prev" href="#carousel-slider" role="button" data-slide="prev">
								<i class="fa fa-chevron-left"></i>
							</a>
							<a class="carousel-control-next" href="#carousel-slider" role="button" data-slide="next">
								<i class="fa fa-chevron-right"></i>
							</a>

						<?php endif;
						wp_reset_postdata();
						// wp_reset_query();

						 ?>
						</div>
						</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- End sliders -->

	<?php else: ?>



	<!-- sliders -->
	<div id="sliders">
		<div class="full-width header-fill">
			<div class="full-width rl-filler" style="">
				&nbsp;
			</div>
		</div>
	</div>



		<?php endif; ?>
