<?php get_header(); ?>
	<div class="wrapper white-dark-bg">
		<div class="page-header">
			<div class="wrapper-inside cf">
				<span class="page-name left"><?php _e("Search","aletheme"); ?></span>

				<?php echo get_breadcrumbs(); ?>
			</div>
		</div>

		<div class="wrapper-inside blog-archive-page">


			<div class="isotope-gutter">
				<div class="gutter"></div>
				<?php $blog_count = 0; if (have_posts()) : while (have_posts()) : the_post();
					$blog_count++;
					if($blog_count == 2){
						$blog_style = ' rounded';
					} elseif($blog_count == 3){
						$blog_style = ' big';
					} elseif($blog_count == 4){
						$blog_style = ' absolute';
					} else {
						$blog_style = '';
					} ?>
					<article <?php post_class('item left' . $blog_style); ?>>
						<?php if($blog_count == 2){
							echo '<div class="image"><a href="' . get_the_permalink() . '">';
							if(get_the_post_thumbnail($post->ID,'post-blog')) {
								echo get_the_post_thumbnail($post->ID,'post-blog');
							} else {
								echo "<img src='http://placehold.it/153x153&amp;text=No+image' alt>";
							}
							echo '</a></div>';
						} elseif($blog_count == 3){
							if(get_the_post_thumbnail($post->ID,'post-archive-big')) {
								echo get_the_post_thumbnail($post->ID,'post-archive-big');
							} else {
								echo "<img src='http://placehold.it/470x344&amp;text=No+image' alt>";
							}
						}  elseif($blog_count == 4){
							if(get_the_post_thumbnail($post->ID,'post-blog3')) {
								echo get_the_post_thumbnail($post->ID,'post-blog3');
							} else {
								echo "<img src='http://placehold.it/225x345&amp;text=No+image' alt>";
							}
						} ?>

						<div class="text">
							<span class="category"><?php the_category(', ');  ?></span>
							<h3>
								<a href="<?php the_permalink(); ?>" class="<?php if($blog_count == 3 || $blog_count == 4){
									echo'white-col';
								} else {
									echo'black-col';
								} ?> red-col-hover"><?php the_title(); ?></a>
							</h3>

							<div class="string">
								<?php if($blog_count == 2){
									echo ale_trim_excerpt(10);
								} elseif($blog_count == 3 || $blog_count == 4){

								} else {
									echo ale_trim_excerpt(20);
								} ?>
							</div>

							<div class="details">
								<span class="date"><?php the_time('j F Y'); ?></span>

								<?php if($blog_count != 3){ ?>
									<span class="comment">
												<i class="fa fa-comment"></i>
										<?php $comments_count = wp_count_comments($post->ID); echo esc_attr($comments_count->total_comments); ?>
											</span>
								<?php } ?>
							</div>

							<a href="<?php the_permalink(); ?>" class="link"><i class="fa fa-angle-right"></i></a>
						</div>
					</article>

			<?php endwhile; else: ?>
				<article class="item story-box story">

						<section class="search-not-found">
							<h2><?php _e('Couldn\'t find what you\'re looking for!', 'aletheme');?></h2>
							<div class="search-more cf">
								<p>Try again with another criteria:</p>
								<?php get_search_form(); ?>
							</div>

						</section>
				</article>
			<?php endif; ?>
			</div>
			<?php echo ale_page_links(); ?>
		</div>
	</div>
<?php get_footer(); ?>