<?php
if (have_posts()) : while (have_posts()) : the_post();
    $count++;
    $image_thumb = '';
    							
    if(has_post_thumbnail(get_the_ID(), 'blog_ft'))
    {
        $image_id = get_post_thumbnail_id(get_the_ID());
        $image_thumb = wp_get_attachment_image_src($image_id, 'blog_ft', true);
    }
?>
    
    
<!-- Begin each blog post -->
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <div class="post_wrapper" <?php if(empty($featured_posts_arr) && $count==1 && is_home()) { ?>style="margin-top:15px;"<?php } ?>>
    	
    	<div class="post_inner_wrapper" <?php if(empty($image_thumb)) { ?>style="margin-top:10px"<?php } ?>>
    	
    	<div class="post_header_wrapper">
    		<div class="post_header">
    			<h3>
    				<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
    			</h3>
    		</div>
    	</div>
    	
    	<br class="clear"/>
    	
    	<a href="<?php the_permalink(); ?>" class="post_comment_number"><?php comments_number('0 دیدگاه', '1 دیدگاه', '% دیدگاه'); ?></a>
    	<div class="post_detail">
    		<img src="<?php echo get_stylesheet_directory_uri(); ?>/images/clock.png" class="middle"/>&nbsp;<?php echo get_the_time('j F Y'); ?>&nbsp;
    		<img src="<?php echo get_stylesheet_directory_uri(); ?>/images/author.png" class="middle"/>&nbsp;<?php echo _e( 'Posted by', THEMEDOMAIN ); ?> <?php echo get_the_author(); ?>
    	</div>
    	
    	<br class="clear"/>
    	
    	<div class="one_half" style="float:right;">
    	<?php
    		if(!empty($image_thumb))
    		{
    	?>
    	
    	<div class="post_img">
    		<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
    			<img src="<?php echo $image_thumb[0]; ?>" alt="<?php the_title(); ?>" class="home_category_ft"/>
    		</a>
    	</div>
    	
    	<?php
    		}
    	?>
    	</div>
    	
    	<div class="one_half last" style="float:left;">
    		<p>
    		<?php
            	echo pp_substr(strip_tags(strip_shortcodes(get_the_content())), 300);
            ?>
    		</p>
    		<a href="<?php the_permalink(); ?>" class="readmore"style="float:right;"><?php echo _e( 'Read more', THEMEDOMAIN ); ?>&larr;</a>
    		<?php 
				$pp_enable_rating = get_option('pp_enable_rating');
				
				if(!empty($pp_enable_rating))
				{
			?>
	            <div class="post_category_rating" style="float:left;>
	            	<?php echo do_shortcode('[ratings id="'.get_the_ID().'" results="true"]'); ?>
	            </div>
	        <?php
	        	}
	        ?>
    	</div>
    	
    	</div>
    	
    </div>
</div>
<br class="clear"/><br/>
    <!-- End each blog post -->

<?php endwhile; endif; ?>

<div class="pagination">
     <?php 
     	if (function_exists("wpapi_pagination")) {
     		wpapi_pagination($wp_query->max_num_pages); 
     	}
     ?>
 </div>