<?php $bauen_options = get_option('bauen'); ?>
<?php get_header(); ?>	   
   
    <?php if (Bauen_AfterSetupTheme::return_thme_option('index_header_show')!='no'){ ?>	
	
	<section class="banner-header banner-img valign bg-img bg-fixed" <?php if (Bauen_AfterSetupTheme::return_thme_option('index_header_overlay_color')=='st2'){ ?>data-overlay-darkgray="5"<?php } else { ?> data-overlay-light="3"<?php  } ;?> data-background="<?php echo esc_url(Bauen_AfterSetupTheme::return_thme_option('index_header_banner_img','url'));?>">
		<!-- Left Panel -->
		<?php if (Bauen_AfterSetupTheme::return_thme_option('nav_menu_style')=='st1'){ ?> 
			<div class="left-panel"></div>
		<?php } 
		else if (Bauen_AfterSetupTheme::return_thme_option('nav_menu_style')=='st2'){ ?> 
		    <div class="left-panel"></div>
		<?php } 
		else { ?>	
			<div class="left-panel-no"></div>			
		<?php } ?>				
	</section>
	<!-- Blog  -->
	<section class="section-static-banner-header">
		<div class="container">
			<div class="row">
			    <div class="col-md-12">
			    <?php get_template_part('template-parts/aniamte/animate-div-start');?>				
					<h2 class="section-title">
						<?php if(!empty($bauen_options['src_page_title'])): ?>
						   <?php echo esc_html(Bauen_AfterSetupTheme::return_thme_option('src_page_title',''));?> <?php printf( esc_html__( ' "%s"', 'bauen' ), '<strong>' . get_search_query() . '</strong>' ); ?>
						<?php else:?>
							<?php esc_html_e('Search Results For:','bauen');?> <?php printf( esc_html__( ' "%s"', 'bauen' ), '<strong>' . get_search_query() . '</strong>' ); ?>
						<?php endif;?>					
					</h2>
				<?php get_template_part('template-parts/aniamte/animate-div-end');?>
				</div>
			</div>
		</div>
	</section>		

	<?php } ?>	
				
	<section class="bauen-blog3 section-padding2">
		<div class="container">
			<div class="row">
				<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
				<?php global $bauen_sidebar_class; ?>
				<?php $bauen_sidebar_class = "col-md-8";?>
				<?php else : ?>
				<?php $bauen_sidebar_class = "col-md-10 offset-1";?>
				<?php endif;?>
				<div class="<?php echo esc_attr($bauen_sidebar_class);?>">					
					<div class="row">	
						<?php global $post, $post_id, $bauen_post_title;?>
						<?php if (have_posts()) : while (have_posts()) : the_post(); ?>		
							<div class="col-md-12"> 
							<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>						
								<div class="item">
									<?php if (has_post_thumbnail( $post->ID ) ):?> 
									<?php $bauen_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), '' );?>
									<?php $bauen_image_id = get_post($id); $bauen_image_title = $bauen_image_id->post_title; ?>
									<div class="post-img">
										<a href="<?php the_permalink();?>"> <img src="<?php echo esc_url($bauen_image[0]);?>" alt="<?php echo esc_attr($bauen_image_title);?>" /> </a>
									</div>
									<?php endif;?>								
									<div class="post-cont"> 
									    <?php if ( is_category() ) { ?>
										<span class="tag"><?php the_category(', ');?></span> <i><?php esc_html_e('|','bauen');?></i> <?php } ?>	<span class="date"><?php the_time( get_option( 'date_format' ) ); ?></span>
										<?php $bauen_post_title= get_the_title(); ?>
										<h5><a href="<?php the_permalink();?>">
											<?php if($bauen_post_title != '') { ?>
												<?php the_title();?>
											<?php } 
											else { ?>	
												<?php the_time( get_option( 'date_format' ) ); ?>
											<?php } ?>											
										</a></h5> 									
										
										<!-- excerpt -->
										<?php if( wp_link_pages('echo=0') ): ?>
											<?php the_content(
												sprintf(
												/* translators: %s: Post title. */
												esc_html__( '', 'bauen' ),
													get_the_title()
													)
												);
												wp_link_pages( array(
													'before'      => '<div class="page-links">',
													'after'       => '</div>',
													'link_before' => '<span>',
													'link_after'  => '</span>',
													'pagelink'    => '%',
													'separator'   => '',
												) );
												?>
										<?php else : ?>
											<?php the_excerpt();?>
										<?php endif;?>	
									</div>
								</div>						
							</div>						
							</div>		
						<?php endwhile; ?>
						<?php wp_reset_postdata();?>	

						<?php else : ?>		
                            <div class="col-md-12"> 
								<div class="blogPost custom-post">
									<div class="item">
										<div class="post-cont"> 
											<h5><?php if(!empty($bauen_options['translet_opt_9'])):?><?php echo esc_html(Bauen_AfterSetupTheme::return_thme_option('translet_opt_9',''));?><?php else : ?><?php esc_html_e('No Results Found','bauen');?><?php endif;?></h5>
										</div>
									</div>
								</div>
							</div>
					    <?php endif;?>
					</div>	
					<!-- pagination start -->
					<?php if (function_exists("bauen_pagination")) {
					bauen_pagination($wp_query->max_num_pages);
					} ?>
					<!-- pagination end -->												
				</div>	
				
				<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
	            <div class="col-md-4">
                    <div class="blog-sidebar">	
                        <?php dynamic_sidebar( 'sidebar-1' ); ?>
                    </div>						
                </div>					
                <?php endif;?>
			</div>

	    </div>
    </section>		
    <!-- section end -->						

<?php get_footer(); ?>	