<?php $latestcount =  $smof_data['latestcount'];?>

                    <div id="latestPostsGrid">
                    	<div class="homeTitle"><h2><i class="icon-doc"></i><?php _e('Latest Posts','lioit') ?></h2></div>
                        <div class="contentBox">
                        	<div id="latestPostsGridCols">
                                <?php query_posts(array('showposts' => $latestcount)); ?>
                  				<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>	
                            	<article class="latestPost">
                            		
                                	<div class="latestPostThumb ">
                                    	
                                    	<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
                                        <?php the_post_thumbnail('columnsimg', array('title' => strip_tags(get_the_title()))); ?>
                                        </a>
                                    </div><!--End LatestPostThumb-->
                                    <aside class="latestPostDetails">
                                    	
                                    	<h3 class="latestPostTitle">
                                        <?php 
											$badge_text = get_post_meta($post->ID, 'lioit_post_badge_text', true);
											$badge_color = get_post_meta($post->ID, 'lioit_post_badge_color', true);
										?>
                                        <?php if ($badge_text) { ?>
                                        <div class="articleType" style="background-color:<?php echo $badge_color; ?>;"><?php echo $badge_text; ?></div>
                                        <?php } ?>
                                        <a href="<?php the_permalink();?>"><?php the_title(''); ?> ...</a></h3>
                                        <ul class="postMeta">
                                        	<?php
                                            $lioit_review_enable =  get_post_meta($post->ID, 'lioit_review_enable', true);
                                            $lioit_review_type =  get_post_meta($post->ID, 'lioit_review_type', true);
                                            $lioit_final_score =  get_post_meta($post->ID, 'lioit_final_score', true);
                                            $lioit_final_percentage = $lioit_final_score * 20 ;
                                        	?>
                                        	<?php if($lioit_review_enable == 'enable'){ ?>
                                            <li>
                                            	<span class="lioit-rating lioit-rating-<?php echo esc_html($lioit_review_type); ?>">
                                                	<span style="width:<?php echo esc_html($lioit_final_percentage); ?>%;"></span>
                                                </span>
                                            </li>
											<?php } ?>
                                            <li class="postViews"><?php echo getPostViews($post->ID); ?> </li>
                                            <li class="postComments"><a href="<?php comments_link();?>"><?php comments_number(__('0 Comments', 'lioit'), __('One Comment', 'lioit'), __('% Comments', 'lioit'));?></a></li>
                                        </ul><!--End postMeta-->
                                    </aside><!--End LatestPostDetails-->
                                </article><!--End LatestPost-->
                                <?php endwhile; ?>
								<?php  else:  ?>
                                <!-- Else in here -->
                                <?php  endif; ?>
                                <?php wp_reset_query(); ?>
                            </div><!--End Latest Posts List-->
                        </div><!--End ContentBox-->
                    </div><!--End Latest Posts-->