<?php get_header(); ?>
<?php
$aOptions = SofaiBloggr::initOptions( false );
$searchresults = ( strlen( $aOptions[ 'searchresults' ] ) > 0 ) ? stripslashes( $aOptions[ 'searchresults' ] ) : 'Found: ';
$for_phrase = ( strlen( $aOptions[ 'for_phrase' ] ) > 0 ) ? stripslashes( $aOptions[ 'for_phrase' ] ) : 'for';
?>

<div id="articles" class="section">
		<h2 class="sectionheader"><?php echo $searchresults; ?> <?php echo $wp_query->found_posts; ?> <?php echo $for_phrase; ?> '<em><?php echo $_GET[ 's' ]; ?></em>'</h2>
           <?php 
		   if( have_posts()) : 
           echo '<ol class="post-list">';
		   ?>
                   <?php while( have_posts() ) : the_post(); ?>
                       
                    <li>
                        <div class="postinfo">
                            <?php
							if( $post->post_type == 'post' ) {
							?>
                            <span class="date"><?php the_time( 'M j, Y' ); ?></span>
                            |
                            <span class="category"><?php the_category( ', ' ); ?></span>
                
                            <span class="comments-count"><?php comments_number( '0', '1', '%' ); ?></span>
                            <?php
							} else {
                            ?>
                            <span class="date">Page</span>
                            <?php
							}
							?>
                        </div>
                        <h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
                    </li>
                       
                   <?php 
				   endwhile; 
				   echo '</ol>';
				   else : 
				   ?>
                   
					<p>No content matching search criteria!</p>
                    
           		   <?php endif; ?>

<div id="pagination">
	<?php 
    if( $wp_query->max_num_pages > 1 ) {
        // paging
        include( "wp-pagenavi.php" );
        if( function_exists( 'wp_pagenavi' ) ) { wp_pagenavi(); }
    } 
    ?>
</div><!-- pagination end -->

</div><!-- // articles end -->

<?php if ( !function_exists( 'dynamic_sidebar' ) || !dynamic_sidebar( 'Footer Archive' ) ) : ?>
<?php endif; ?>
           
<?php get_footer(); ?>