Current File : /home/bwalansa/www/wp-content.backup/themes/Savia/single-portfolio_full.php_old
<?php 
/**
 * Template Name Posts: /*Portfolio Full Width*/
 */

get_header(); ?>

<div class="content_bgr">

<?php	// Shall we display the page heading
		$hide_heading = get_post_meta($post->ID, 'boc_page_heading_set', true);
		if($hide_heading!=='yes') {
?>
		<div class="full_container_page_title">
			<div class="container animationStart startNow">
				<div class="row no_bm">
					<div class="sixteen columns">
						<?php boc_breadcrumbs(); ?>
						<div class="page_heading"><h1><?php the_title(); ?></h1></div>
					</div>
				</div>
			</div>
		</div>
<?php 	} ?>



	<div class="container">	
		
		<div class="row portfolio_page">

				
	
	<?php while(have_posts()): the_post(); ?>
		<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
			
			<?php
			$args = array(
			    'post_type' => 'attachment',
			    'numberposts' => '16',
			    'post_status' => null,
			    'post_parent' => $post->ID,
				'orderby' => 'menu_order',
				'order' => 'ASC',
				'exclude' => get_post_thumbnail_id()
			);
			$attachments = get_posts($args);
			
			if($attachments || has_post_thumbnail()):
			?>


		<?php // IF Post type is Standard (false) 	
		if(function_exists( 'get_post_format' ) && get_post_format( $post->ID ) != 'gallery' && get_post_format( $post->ID ) != 'video' && has_post_thumbnail()) { ?> 
			
			<div class="portfolio_media sixteen columns">
					
					<?php if(has_post_thumbnail()): ?>

						<?php $attachment_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); ?>
						<div class="pic animationStart">
							<a href="<?php echo $attachment_image[0]; ?>" rel="prettyPhoto" title="<?php echo $attachment->post_title; ?>">
							  	<img src="<?php echo $attachment_image[0]; ?>" alt=" "/><div class="img_overlay_zoom"><span class="icon_zoom"></span></div>			  		
							</a>
						</div>
						
					<?php endif; ?>

			</div>
		
		<?php } // IF Post type is Standard :: END ?>
		
		<?php // IF Post type is Gallery
		if (( function_exists( 'get_post_format' ) && get_post_format( $post->ID ) == 'gallery' )) { ?>
			
			<div class="flexslider portfolio_media sixteen columns">			
				<ul class="slides">
		        	<?php if(has_post_thumbnail()): ?>
					<?php $attachment_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'portfolio'); ?>
					<?php $attachment_data = wp_get_attachment_metadata(get_post_thumbnail_id()); ?>	
					<li class="pic">
						<a href="<?php echo $attachment_image[0]; ?>" rel="prettyPhoto['portfolio']" title="<?php the_title(); ?>">
							<img src="<?php echo $attachment_image[0]; ?>" alt="" /><div class="img_overlay_zoom"><span class="icon_zoom"></span></div>
						</a>
					</li>
					<?php endif; ?>
		        	<?php foreach($attachments as $attachment): ?>
						<?php $attachment_image = wp_get_attachment_image_src($attachment->ID, 'portfolio'); ?>
						<?php $attachment_data = wp_get_attachment_metadata($attachment->ID); ?>
					<li class="pic">
						<a href="<?php echo $attachment_image[0]; ?>" rel="prettyPhoto['portfolio']" title="<?php echo $attachment->post_title; ?>">
							<img src="<?php echo $attachment_image[0]; ?>" alt="" /><div class="img_overlay_zoom"><span class="icon_zoom"></span></div>
						</a>
					</li>
					<?php endforeach; ?>
		        </ul>
			</div>			
				
		<?php } // IF Post type is Gallery :: END ?>
		
		<?php	// IF Post type is Video 
		if (( function_exists( 'get_post_format' ) && get_post_format( $post->ID ) == 'video')  ) {					
			if($video_embed_code = get_post_meta($post->ID, 'video_embed_code', true)) {
				echo "<div class='sixteen columns mt20'>";
				echo "<div class='video_max_scale'>";
				echo $video_embed_code;
				echo "</div>";
				echo '</div>';
			}										
		} // IF Post type is Video :: END 
		?>

		<?php endif; ?>
			
			<div class="h20 clear"></div>

		</div>
	</div>
 </div>
 
<?php the_content(); ?>


<?php if(ot_get_option('related_portfolio_projects', 'on') == 'on'){ ?>
		<?php $projects = get_related_portfolio_items($post->ID); ?>
		<?php if($projects->have_posts()): ?>
		
		<?php 
		
		$portfolio_style = ot_get_option('portfolio_style') ? ot_get_option('portfolio_style') : 'type1';
					
		$str.='<div class="h20"></div>
		<div class="container">
		  <div class="sixteen columns">
			<div class="info_block animationStart">
				<div class="h10 clear"></div>
				<h2 class="title"><span>'.__("Related Portfolio Items", "Savia").'</span></h2>
				<div class="clear h20"></div>
				<div class="carousel_section">
					<div class="carousel_arrows_bgr"></div>
					<ul id="portfolio_carousel">';
						while($projects->have_posts()): $projects->the_post(); 
						if(has_post_thumbnail()): 
						
							$taxonomy = 'portfolio_category';
							$terms = get_the_terms( $post->ID , $taxonomy );
							$cats = array();
							
							if (! empty( $terms ) ) :
								foreach ( $terms as $term ) {
									
									$link = get_term_link( $term, $taxonomy );
									if ( !is_wp_error( $link ) )
										$cats[] = $term->name;
								}
							endif;
						
							$str.=
								'
								<li class="one-third column info_item">
									<a href="'.get_permalink().'" title="" class="pic_info_link_'.$portfolio_style.'">
										<div class="pic_info '.$portfolio_style.'">
											<div class="pic_holder"><div class="plus_overlay"></div><div class="plus_overlay_icon"></div>'.get_the_post_thumbnail($projects->post->ID, 'portfolio-medium').'<div class="img_overlay_icon"><span class="portfolio_icon icon_'.getPortfolioItemIcon($projects->post->ID).'"></span></div></div>
											<div class="info_overlay">
												<div class="info_overlay_padding">
													<div class="info_desc">
														<span class="portfolio_icon icon_'.getPortfolioItemIcon($projects->post->ID).'"></span>
														<h3>'.get_the_title().'</h3>
														<p>'.implode(' / ', $cats).'</p>
													</div>
												</div>
											</div>
										</div>
									</a>
								</li>
								';
							
							
						endif; endwhile;
						$str.='
					</ul>
				</div>
			</div>

			<div class="h20 clear"></div>
						
			<script type="text/javascript">
				jQuery(document).ready(function() {
					jQuery("#portfolio_carousel").jcarousel({
						scroll: (jQuery(window).width() > 768 ? 3 : 1),
						easing: "easeInOutExpo",
						animation: 600
					});
				});	
				
				
				// Reload carousels on window resize to scroll only 1 item if viewport is small
				jQuery(window).resize(function() {
					 var el = jQuery("#portfolio_carousel"), carousel = el.data("jcarousel"), win_width = jQuery(window).width();
					   var visibleItems = (win_width > 768 ? 3 : 1);
					   carousel.options.visible = visibleItems;
					   carousel.options.scroll = visibleItems;
					   carousel.reload();
				});
			</script>
		  </div>
		</div>';

		
		echo $str; ?>
		
		
		<?php endif; ?>

	<?php } // RELATED PROJECTS :: END ?>


	<?php endwhile; // END LOOP ?>
	</div>
</div>

<?php get_footer(); ?>