<?php
/*
 *
 Template Name: Portfolio One Column
 * 
 * This template is used to display the one-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 $wp_query = new WP_Query(array('cat'=>of_get_option('categories_portfolio_one'),'showposts'=>of_get_option('postnumber_portfolio_one'),'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]; ?>
        
			<!-- BEGIN .portfolio-item -->
			<div class="portfolio-item">	

                <?php if ( $video ) : ?>
              		<div class="feature_vid"><?php echo $video; ?></div>
				<?php else: ?>
            		<a class="feature_img" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'portfolio-large' ); ?></a>
        		<?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>
            
			<?php endwhile; ?>
            
    		<div class="pagination">
    			<?php if (function_exists("number_paginate")) { number_paginate(); } ?>
    		</div>
    
    		<?php else : // do not delete ?>

    		<h1 class="headline"><?php _e("Page not Found", 'organicthemes'); ?></h1>
    		<p><?php _e("We're sorry, but the page you're looking for isn't here.", '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>

			<?php endif; // do not delete ?>

		<!-- END .hentry -->
		</div>
		
	<!-- END .row -->
	</div>

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

<?php get_footer(); ?>