 <?php 
    $GLOBALS['img']='cat';
    get_header(); 
 ?>
 
    <div class="row-fluid top">
        
    <?php
        if(of_get_option('layer_img') == 'right'){
            $span8 = 'span8';
            $pos = 'right';  
        }else if(of_get_option('layer_img') == 'left'){
            $span8 = 'span8';
            $pos = 'left';
        }else{
            $span8 = 'span12';
            $pos = 'none';
        }                    
        if($pos == 'left'){echo '<div class="span4">'; get_sidebar(); echo '</div>';}
     ?>
        
        <div class="<?php echo $span8;?>">
		
            <!-- blog  -->
            
			<?php
                $paginar=1;
                $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
                $catID = get_query_var('cat');
                $post_per_page = get_query_var('post_per_page');
                query_posts('cat='.$catID.'&posts_per_page='.$posts_per_page.'&paged='.$paged);
                while (have_posts()) {  
                the_post();                               
                $day = get_the_time('j');
                $month = get_the_time('m');
                $year = get_the_time('Y');
            ?>
			
            <div class="blog">
			
                <div class="row-fluid">
              
			        <div class="span12">
                        
						<div class="post">
                            
							<div class="post_img">
                                
								<a <?php echo colors('a');?>  href="<?php the_permalink();?>">
                    
                                    <?php
                                        if( has_post_thumbnail($post->ID) ) { the_post_thumbnail('full', array('alt'=>$post->post_title)); }
                                        else { echo '<img src="' . get_template_directory_uri('template_directory') . '/img/default.jpg" />'; }
                                    ?>
                                
								</a>
								
                                <div class="post_hover">
								
                                    <h3 <?php echo colors('h3');?> ><?php the_title();?></h3> 
                                
								</div>
                            
							</div>

                            <ul>
							
                                <li><a <?php echo colors('a');?>  href="<?php the_permalink();?>"><i class="icon-group"></i><?php the_author();?></a></li>
                                <li><a <?php echo colors('a');?>  href="<?php the_permalink();?>"><i class="icon-tag"></i><?php echo $day.'/'.$month.'/'.$year;?></a></li>
                                <li><a <?php echo colors('a');?>  href="<?php the_permalink();?>"><i class="icon-quote-left"></i><?php comments_number();?></a></li>
                            
							</ul>

                            <p <?php echo colors('p');?> ><?php echo wp_trim_words(get_the_content(),40,'...');?></p> 
                  
				            <a <?php echo colors('btn');?>  href="<?php the_permalink();?>" class="botton">read more</a> 

                        </div>
						
                    </div>

                </div>
				
            </div>
			
            </br>
			
            <?php }?>
			
            <!-- end blog  -->

            <div class="row-fluid">

                <ul class="pagination">

                    <?php if ($paginar == '1') { newhost_pagination();}
                    else { next_posts_link('&larr; '.'Older posts', 'mythemeshop' ); previous_posts_link('Newer posts'.' &rarr;', 'mythemeshop' );} ?>
					
                </ul>
              
            </div>

        </div>

        <?php
           if($pos == 'right'){echo '<div class="span4">'; get_sidebar(); echo '</div>';}
        ?>

    </div>
	
    </div>
   
<?php get_footer(); ?>