<?php get_header();?>
<div class="content-wrapper">
	<div class="container">	
		  <div class="title">
        <h3 class="title_text"><?php _e('Result','hybrid_lang'); ?></h3>
    </div><!--END title -->
	<div class="row">
		<div class="span12" id="blog-container">
			<div id="items">
				<div class="span0"></div>
					<?php  while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>				
						<div class="item blog-item span3">
							<a href="<?php the_permalink()?>">
							<?php if(has_post_thumbnail()){ ?>
										<?php
										$image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID),'home1-blog');
										echo '<img src="'. $image[0].'"/>';	
										}							
								else{
										echo '<img src="'.get_template_directory_uri().'/img/archive.jpg"/>';  
									}?>						
							</a>		
							<div class="blog-desc">
									<div class="border-container">
									<div class="comment-size-box">
										<p class="comment-number">
											<?php  echo get_comments_number($post->post_id);  ?>
										</p>
									</div>
									<div class="triangle-box">
										<div class="triangle triangle-border"></div>
										<div class="triangle triangle-body"></div>
									</div>
									</div>
									 <a href="<?php the_permalink()?>">
										<p class="post-title"><?php the_title();?></p>
										<p class="post-categoty">
										<?php 
												$post_categories = wp_get_post_categories( $post->ID );								
												$categories = '';	
												foreach($post_categories as $c){
													$cat = get_category( $c );									
													$categories = $categories.' '.$cat->name;
												}
												if($categories!=''){
													echo 'Posted in '.$categories;
												}
										?></p>
												<?php $excerpt = get_the_excerpt();?>
										<p class="desc">
											<?php echo $excerpt; ?>										
										</p>
									</a>
							</div>
						</div>	<!--blog item-->
					<?php endwhile;?>
			</div>
		</div>
	</div>	
        <br/>
	</div>
        <?php if ( $wp_query->max_num_pages > 1 ) : ?>
        <div class="post_nav">
            <nav id="<?php echo $nav_id; ?>">
                <h3 class="assistive-text"><?php _e( 'Post navigation', 'hybrid_lang' ); ?></h3>
                <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'hybrid_lang' ) ); ?></div>
                <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'hybrid_lang' ) ); ?></div>
            </nav><!-- #nav-above -->
            <?php wp_link_pages(); ?>
        </div>
        <?php endif;?>
	</div>
</div>
<?php get_footer();?>