<?php $bauen_options = get_option('bauen'); ?>
<?php while ( have_posts() ) : the_post(); ?>
	<section class="bauen-blog3 section-padding2 default-right-page">
		<div class="container">
			<div class="row">
				<?php if ( is_active_sidebar( 'sidebar-2' ) ) : ?>
				<?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">	
						<div class="col-md-12"> 
							<div class="page-content">
							<?php the_content();
								wp_link_pages( array(
								'before'      => '<div class="page-links">',
								'after'       => '</div>',
								'link_before' => '<span>',
								'link_after'  => '</span>',
								'pagelink'    => '%',
								'separator'   => '',
								) );
							?>
							</div>	
				        </div>
						<?php if ( comments_open() || get_comments_number() ) { ?>	
						<div class="blogPost comments">												
							<?php comments_template();?>								
						</div>
						<?php }?>							
				    </div>
				</div>
				<!-- page end -->
				
				<?php if ( is_active_sidebar( 'sidebar-2' ) ) : ?>
	            <div class="col-md-4">
                    <div class="blog-sidebar">	
                        <?php dynamic_sidebar( 'sidebar-2' ); ?>
                    </div>						
                </div>					
                <?php endif;?>
			</div>	
	    </div>
    </section>		
    <!-- section end -->					
<?php endwhile; ?>
<?php wp_reset_postdata();?> 