<?php

$meta = _WSH()->get_meta('_sh_layout_settings');

$layout = sh_set( $meta, 'layout', 'full' );
$sidebar = sh_set( $meta, 'sidebar', 'default-sidebar' );
$bg = sh_set( $meta, 'bg_image' );
$bg = ( $bg ) ? $bg : get_template_directory_uri().'/images/other/parallax.jpg';
$title = sh_set( $meta, 'search_page_title', 'Portfolio' );

$classes = ( !$layout || $layout == 'full' ) ? ' col-lg-12 col-md-12' : ' col-lg-7 col-md-7';
?>

<?php if(!sh_set($_GET, 'ajax')) :

    get_header(); 

    /** Update the post views counter */
    //_WSH()->post_views( true );
    ?>


    <div class="page-header parallax" style="background-image: url(<?php echo esc_url($bg); ?>);"></div>

    <?php get_template_part('includes/modules/nav'); 

endif; ?>



<!-- === START PROJECT SECTION === -->
        <section class="section padding" id="project-section">
            <div class="container">
                
                <div class="row">
				
					<?php while( have_posts() ): the_post(); 

                    $meta = _WSH()->get_meta();?>
					<div class="col-md-5">
                        <h1><?php the_title();?></h1>
                        <div class="project-data">
                            
                            <?php the_content();?>

							
                            <div class="project-details d-bg-c">
                                <h2><?php esc_html_e('Portfolio Details', SH_NAME); ?></h2>
                                <ul>
                                    <?php if( $customer = sh_set( $meta, 'customer' ) ): ?>
										<li><span><?php esc_html_e('Client:', SH_NAME); ?></span> <?php echo balanceTags($customer); ?></li>
									<?php endif; ?>
										
                                    <?php if( $customer = sh_set( $meta, 'live_demo' ) ): ?>
										<li><span><?php esc_html_e('Website:', SH_NAME); ?></span> <a href="<?php echo esc_url($customer); ?>"><?php echo esc_url( $customer ); ?></a></li>
                                    <?php endif; ?>
									
									<?php if( get_the_terms(get_the_id(), 'portfolio_category' ) ): ?>
										<li><span><?php esc_html_e('Category:', SH_NAME); ?></span> <?php the_terms(get_the_id(), 'portfolio_category', '', ' '); ?></li>
                                    <?php endif; ?>
									
									<?php if( $customer = sh_set( $meta, 'skills' ) ): ?>
										<li><span><?php esc_html_e('Skill:', SH_NAME); ?></span> <?php echo balanceTags($customer); ?></li>
                                    <?php endif; ?>
									
									<?php if( $customer = sh_set( $meta, 'launch_date' ) ): ?>
										<li><span><?php esc_html_e('Release Date:', SH_NAME); ?></span> <?php echo date( get_option('date_format' ), strtotime( $customer) ); ?></li>
                                    <?php endif; ?>

                                    <?php if( $ext_details = sh_set( $meta, 'extra_detail' ) ): 

                                        foreach($ext_details as $key => $value):?>
									       <li><span><?php echo esc_attr(sh_set( $value, 'label')); ?></span> <?php echo  esc_attr(sh_set( $value, 'value')); ?></li>
                                        <?php endforeach; ?>
                                    <?php endif; ?>
									
								</ul>
                            </div>
                        </div>
                    </div>
					
                    <div class="col-md-7">
                        <div class="project-cover">
                            <div class="portfolio-carousel white">
                                <?php //printr($meta);
                                $portfolio_images = sh_set( $meta, 'portfolio_images');
                                $video = sh_set( $meta, 'video' );
                                $audio = sh_set( $meta, 'audio' );

                                foreach($portfolio_images as $p_image): ?>
                                
                                    <div class="item">
                                        <img src="<?php echo esc_url(sh_set( $p_image, 'image')); ?>" alt="">
                                    </div> <!-- / .client -->

                                <?php endforeach; ?>

                                <div class="item">
                                    <?php the_post_thumbnail( '650x500' );?>
                                </div>
                            </div>
                        </div>
                    </div>
					
					<?php endwhile; ?>
                    
                </div>
            

                <?php comments_template(); ?>
				
            </div>
        </section>
<!-- === END PROJECT SECTION === -->


<?php if(!sh_set($_GET, 'ajax'))
get_footer(); ?>