<?php $bauen_options = get_option('bauen'); ?>
<?php get_header();?>

     <?php get_template_part('template-parts/header/intro'); ?> 

	<?php while ( have_posts() ) : the_post(); ?>
	<?php if(get_post_meta($post->ID,'bauen_wr_portfoliotype_container',true)=='st2'){ ?>

		<?php the_content();
			wp_link_pages( array(
			'before'      => '<div class="page-links">',
			'after'       => '</div>',
			'link_before' => '<span>',
			'link_after'  => '</span>',
			'pagelink'    => '%',
			'separator'   => '',
			) );
		?>

	<?php } else { ?>
		<!-- section start -->
		<section class="section-padding2">
			<!-- container start -->
			<div class="container">
				<!-- row start -->
				<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>
				</div>
			</div>
		</section>
	<?php };?>
	    
	
	<?php if(get_post_meta($post->ID,'bauen_portfolio_prev_naxt_selector_opt',true)!='no'){ ?>
	
		<!-- Prev-Next Projects -->
		<section class="projects-prev-next">
			<div class="container">
				<div class="row">
					<div class="col-md-12">
						<div class="d-sm-flex align-items-center justify-content-between">

							<?php $bauen_next_post = get_next_post();
							$bauen_next_url = is_object( $bauen_next_post ) ? get_permalink( $bauen_next_post->ID ) : '';
							?>				
							<?php  if ($bauen_next_post) { ?>
							
							<div class="projects-prev-next-left">
								<a href="<?php echo esc_url( $bauen_next_url ); ?>"> <i class="ti-arrow-left"></i> <?php if(!empty($bauen_options['translet_opt_5'])):?><?php echo esc_html(Bauen_AfterSetupTheme::return_thme_option('translet_opt_5',''));?><?php else : ?><?php esc_html_e('Previous Project','bauen');?><?php endif;?>
								</a>
							</div> 	
							
			                <?php } else { ?>
							
							<div class="projects-prev-next-left">
							    <?php if(!empty($bauen_options['port_page_url'])): ?>
								<a href="<?php echo esc_url($bauen_options['port_page_url']);?>"> <i class="ti-arrow-left"></i> <?php if(!empty($bauen_options['back_port'])):?><?php echo esc_html(Bauen_AfterSetupTheme::return_thme_option('back_port',''));?><?php else : ?><?php esc_html_e('Back To Portfolio','bauen');?><?php endif;?>
								</a>
								<?php else : ?>
								<a href="<?php echo esc_url( home_url( '/' ) ); ?>"> <i class="ti-arrow-left"></i> <?php if(!empty($bauen_options['back_home'])):?><?php echo esc_html(Bauen_AfterSetupTheme::return_thme_option('back_home',''));?> <?php else : ?><?php esc_html_e('Back To Home','bauen');?> <?php endif;?>	
								</a>
								<?php endif;?>	
							</div> 		

							<?php } ;?>	
												
							
							<?php if(!empty($bauen_options['port_page_url'])): ?>
								<a href="<?php echo esc_url($bauen_options['port_page_url']);?>"> <i class="ti-layout-grid3-alt"></i>
								</a>
							<?php else : ?>
							    <a href="<?php echo esc_url( home_url( '/' ) ); ?>"> <i class="ti-layout-grid3-alt"></i>
								</a>
							<?php endif;?>		

							
                            <?php $bauen_previous_post = get_previous_post();
							$bauen_previous_url = is_object( $bauen_previous_post ) ? get_permalink( $bauen_previous_post->ID ) : '';
							?>		
				            <?php if ($bauen_previous_post) { ?>
							
							<div class="projects-prev-next-right">
								<a href="<?php echo esc_url( $bauen_previous_url ); ?>"> <?php if(!empty($bauen_options['translet_opt_6'])):?><?php echo esc_html(Bauen_AfterSetupTheme::return_thme_option('translet_opt_6',''));?><?php else : ?><?php esc_html_e('Next Project','bauen');?><?php endif;?> <i class="ti-arrow-right"></i>
								</a>
							</div> 	
							
			                <?php } else { ?>
							
							<div class="projects-prev-next-right">
							    <?php if(!empty($bauen_options['port_page_url'])): ?>
								<a href="<?php echo esc_url($bauen_options['port_page_url']);?>"> <?php if(!empty($bauen_options['back_port'])):?><?php echo esc_html(Bauen_AfterSetupTheme::return_thme_option('back_port',''));?><?php else : ?><?php esc_html_e('Back To Portfolio','bauen');?><?php endif;?> <i class="ti-arrow-right"></i>
								</a>
								<?php else : ?>
								<a href="<?php echo esc_url( home_url( '/' ) ); ?>"> <?php if(!empty($bauen_options['back_home'])):?><?php echo esc_html(Bauen_AfterSetupTheme::return_thme_option('back_home',''));?> <?php else : ?><?php esc_html_e('Back To Home','bauen');?> <?php endif;?> <i class="ti-arrow-right"></i>	
								</a>
								<?php endif;?>	
							</div> 		

							<?php } ;?>									

						</div>
					</div>
				</div>
			</div>
		</section>
	
	<?php };?>
	
	<?php endwhile; ?>
	<?php wp_reset_postdata();?>
<?php get_footer(); ?>