<?php
/*
 *
 Template Name: Portfolio Two Column
 * 
 * This template is used to display the two-column portfolio page. 
 *
 */ 
 get_header(); ?>

<?php if ( has_post_thumbnail()) { ?>
	<div class="row">
		<div id="banner"><?php the_post_thumbnail( 'banner' ); ?></div>
	</div>
<?php } else { } ?>

<!-- #content -->
<div id="content">
	
	<!-- .row -->
	<div class="row portfolio">

		<!-- BEGIN .hentry -->
		<div <?php post_class(); ?> id="page-<?php the_ID(); ?>">
	    
	    	<h1 class="headline alt"><?php the_title(); ?></h1>
	        
			<?php $first_or_second = 'first'; ?>  
			<?php $wp_query = new WP_Query(array('cat'=>of_get_option('categories_portfolio_two'),'showposts'=>of_get_option('postnumber_portfolio_two'),'paged'=>$paged)); ?>
			<?php if($wp_query->have_posts()) : while($wp_query->have_posts()) : $wp_query->the_post(); ?>
			<?php $meta_box = get_post_custom($post->ID); $video = $meta_box['custom_meta_video'][0]; ?>
			<?php global $more; $more = 0; ?>
	        
			<!-- BEGIN .six columns -->
			<div class="six columns <?php echo $first_or_second; ?>">
			<?php $first_or_second = ('first'==$first_or_second) ? 'second' : 'first'; ?> 
		
				<!-- BEGIN .portfolio-item -->
				<div class="portfolio-item">
		
		    		<?php if ( $video ) : ?>
		        			<div class="feature_vid"><?php echo $video; ?></div>
		    		<?php else: ?>
		        			<div class="feature_img"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'portfolio-medium' ); ?></a></div>
		    		<?php endif; ?>
		        
		        	<?php if(of_get_option('display_portfolio_page_info') == '1') { ?>
		        	    <div class="information">              
		        	        <h2 class="title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
		        	        <?php the_excerpt(); ?>
		        	    </div><!-- information -->
		        	<?php } else { ?>
		        	<?php } ?>
		        
				<!-- END .portfolio-item -->
		        </div>
		
			<!-- END .six columns -->
			</div>
		                            
			<?php endwhile; ?>
		
			<div class="pagination">
				<?php if (function_exists("number_paginate")) { number_paginate(); } ?>
			</div>
		
			<?php else : // do not delete ?>
		
			<div class="twelve columns">
			
				<div class="article">
					<h1 class="headline"><?php _e("No Posts Found", 'organicthemes'); ?></h1>
					<p><?php _e("We're sorry, but no posts were found for this category.", 'organicthemes'); ?></p>
					<p><?php _e("Try searching for the page you are looking for or using the navigation in the header or sidebar.", 'organicthemes'); ?></p>
				</div>
				
			</div><!-- .twelve columns -->
		
		    <?php endif; // do not delete ?>
	
		<!-- END .hentry -->
		</div>
	
	<!-- .row -->
	</div>

<!-- #content -->	
</div>

<?php get_footer(); ?>