<?php
/*
 * The search template for our theme.
 *
 * This template is used to display search results.
 *
 * @package Portfolio
 * @since Portfolio 1.0
 * 
 */ 
 get_header(); ?>

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

	    <!-- BEGIN .eight columns -->
	    <div class="eight columns">
	
	        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
	        <?php $meta_box = get_post_custom($post->ID); $video = $meta_box['custom_meta_video'][0]; ?>
	        
	        <!-- BEGIN .hentry -->
	        <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
	        
	        	<div class="datebox">
	        	    <div class="month"><?php the_time(__("M", 'organicthemes')); ?></div>
	        	    <div class="day"><?php the_time(__("j", 'organicthemes')); ?></div>
	        	</div>
	
				<!-- BEGIN .article -->
				<div class="article">
				
			        <h2 class="headline alt"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
			        
			        <?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( 'archive-thumb' ); ?></a></div>
			        <?php endif; ?>
			
			        <?php the_excerpt(); ?>
		        
		        <!-- END .article -->
		        </div>
	        
	        <!-- END .hentry -->
	        </div> 
	
	        <?php endwhile; else: ?>         
	        <p><?php _e("Sorry, no posts matched your criteria.", 'organicthemes'); ?></p>
	        <?php endif; ?>
	        
	        <div class="pagination">
	        	<?php if (function_exists("number_paginate")) { number_paginate(); } ?>
	        </div>
	
	    <!-- END .eight columns -->
	    </div>
	
	    <div class="four columns">
	        <?php get_sidebar(); ?> 
	    </div><!-- .four columns -->

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

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

<?php get_footer(); ?>