<?php
/**
 * The default template for displaying Single Project
 *
 * @package WordPress
 * @subpackage Charity
 * @since Charity 1.0
 */
?>
<?php
	the_post();
	$wplook_page_meta 			=  get_post_meta($post->ID);
	$wplook_project_status 		=  isset($wplook_page_meta['wpl_project_status'][0]) ? $wplook_page_meta['wpl_project_status'][0] : "";
	$wplook_project_details 	=  isset($wplook_page_meta['wpl_project_details'][0]) ? maybe_unserialize($wplook_page_meta['wpl_project_details'][0]) : false;
	$wplook_project_location 	=  isset($wplook_page_meta['wpl_project_location_map'][0]) ? $wplook_page_meta['wpl_project_location_map'][0] : "";
	$wplook_sidebar_position 	=  isset($wplook_page_meta['wpl_cpt_sidebar_position'][0]) ? $wplook_page_meta['wpl_cpt_sidebar_position'][0] : "right";
	$wplook_page_sidebar  		=  (isset($wplook_page_meta['wpl_cpt_sidebar_select'][0]) && $wplook_page_meta['wpl_cpt_sidebar_select'][0] != '') ? $wplook_page_meta['wpl_cpt_sidebar_select'][0] : "project-1";
	$wplook_page_header 		=  (isset($wplook_page_meta['wpl_page_header'][0]) && $wplook_page_meta['wpl_page_header'][0] != '') ? $wplook_page_meta['wpl_page_header'][0] : false;
?>
<?php get_header(); ?>

	<div class="main">
		<div class="main-head">
			<div class="main-head-image fullscreener">
				<?php
					if ( $wplook_page_header ) {
						echo '<img class="hide" src="'. esc_url( $wplook_page_header ).'">';
					}?>
			</div><!-- /.main-head-image fullscreener -->

			<div class="main-head-content">
				<div class="grid-container">
					<div class="grid-x grid-margin-x">
						<div class="cell small-12">
							<h1 class="main-title main-title-alt"><?php the_title(); ?></h1><!-- /.main-title main-title-alt -->
							<?php if (ot_get_option('wpl_breadcrumbs_status') == 'on') : ?>
								<ul class="breadcrumbs">
									<?php wplook_breadcrumbs(); ?>
								</ul><!-- /.breadcrumbs -->
							<?php endif; ?>
						</div><!-- /.cell small-12 -->
					</div><!-- /.grid-x grid-margin-x -->
				</div><!-- /.grid-container -->
			</div><!-- /.main-head-content -->
		</div><!-- /.main-head -->
		<div class="main-body">
			<div class="grid-container">
				<div class="grid-x grid-margin-x">
					<div class="cell small-12 <?php if ( $wplook_sidebar_position == 'right') { echo "large-8";} elseif ( $wplook_sidebar_position == 'disable' ) {echo "large-12"; } else { echo " large-8 right";} ?>">
						<div class="content">
							<article id="post-<?php the_ID(); ?>" <?php post_class('post post-single post-document'); ?>>
								<div class="post-body">
									<div class="entry" itemprop="articleBody">
										<?php the_content(); ?>
									</div>
								</div>
							</article>
						</div><!-- /.content -->
					</div><!-- /.cell large-8 -->

					<?php if ( $wplook_sidebar_position != 'disable') { ?>
						<div id="sidebar" class="cell large-3 large-offset-1">
							<div class="sidebar">

								<div class="widget widget-details">
									<div class="widget-head">
										<h4 class="widget-title"><?php _e('Project Details', 'charity-wpl' ); ?></h4><!-- /.widget-title -->
									</div><!-- /.widget-head -->

									<div class="widget-body single-cause-meta">
										<ul class="side-nav">
											<?php
												if ($wplook_project_status) {
													echo '<li><i class="fas fa-bullhorn"></i> '.$wplook_project_status.'</li>';
												}

											?>
											<?php
												if ($wplook_project_details){
													foreach ($wplook_project_details as $key => $detail) {
														echo '<li><i class="'.$detail["wpl_project_details_icon"].'"></i>'. $detail["wpl_project_details_description"].'</li>';
													}
												}
											?>
										</ul><!-- /.side-nav -->
									</div><!-- /.widget-body -->
								</div><!-- /.widget widget-details -->

								<?php dynamic_sidebar( $wplook_page_sidebar ); ?>
							</div><!-- /.sidebar -->
						</div><!-- /.cell large-3 large-offset-1 -->
					<?php } ?>
				</div><!-- /.grid-x grid-margin-x -->
			</div><!-- /.grid-container -->
		</div><!-- /.main-body -->
	</div><!-- /.main -->

<?php get_footer(); ?>
