<?php 
/**
 * Search page to display Search results.
 *
 * @package Outset
 * @since Outset 1.1
 */
get_header(); ?>

<div class="row">
	<div class="span8">
		<?php if ( have_posts() ) : ?>
			<h2><?php printf( __( 'Search Results for: %s', 'outset' ), '<span>' . get_search_query() . '</span>' ); ?></h2>
				<?php
				/* Run the loop for the search to output the results.
				 * If you want to overload this in a child theme then include a file
				 * called loop-search.php and that will be used instead.
				 */
				 get_template_part( 'loop', 'search' );
				?>
				<hr>
		
		<?php while (have_posts()) : the_post(); ?>
			<div class="post" id="post-<?php the_ID(); ?>">
				<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
	<?php
		if ( function_exists('the_excerpt') && is_search() ) {
			the_excerpt();
		} ?>
			<p><?php the_time('F jS, Y') ?> &nbsp;|&nbsp; Published in <?php the_category(', ');
				if($post->comment_count > 0) {
					echo ' &nbsp;|&nbsp; ';
						comments_popup_link('', '1 Comment', '% Comments');
				}
			?>
			</p>
			</div>
		<hr>
		<?php endwhile; ?>
		
	<?php else : ?>
		<div id="post-0" class="post no-results not-found">
			<h2 class="entry-title"><?php _e( 'Nothing Found', 'outset' ); ?></h2>
				<div class="entry-content">
					<p><?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'outset' ); ?></p>
						<?php get_search_form(); ?>
				</div><!-- .entry-content -->
		</div><!-- #post-0 -->
<?php endif; ?>
<?php page_navi(); ?>

	</div>
<div class="span4">
	<?php get_sidebar(); ?>	
</div>
</div>

<?php get_footer(); ?>