<?php
  
function ventoux_custom_loop( $atts, $content = null ) {
	ob_start();?>
	<div class="vf-wrapper vf-blogfeed-background animatedParent animateOnce" data-appear-top-offset='-300'>
	<div class="vf-row vf-pr-10 vf-pl-10 animated fadeInLeftShort">
	
	

<?php

$showPosts = get_theme_mod('blog_feed_qty');

if (get_theme_mod('blog_feed_qty')){
$args = array('posts_per_page' => $showPosts,);
}else{
	$args = array('posts_per_page' => 3);
}
$homeFeed = new WP_Query( $args);

if ($homeFeed->have_posts() ) : 

while ($homeFeed->have_posts() ) : $homeFeed->the_post(); ?>

<div class="vf-custom-padding vf-col-<?php if (get_theme_mod('blog_column_qty')) {
	echo get_theme_mod('blog_column_qty');
} else {
	echo "4";
} ?> vf-pt-100 vf-pb-100 vf-col-12-xs">
<?php the_title( sprintf( '<h6 class="vf-entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h6>' ); ?>

<p class="vf-home-meta">
	
	<span class="vf-meta-comments"><i class="icon_comment_alt"> </i><?php comments_number( 'no comments', 'one comment', '% comments' ); ?></span>
	<span class="vf-meta-date"><i class="icon_calendar"> </i><?php the_time('m/j/y ') ?></span>
	
</p>

<p>


			<div id="effect-3" class="effects clearfix">
			    <div class="img">
			        <?php if ( has_post_thumbnail() ) : ?>
		<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
			<?php the_post_thumbnail(); ?>
		</a>
	<?php endif; ?>
			        <div class="overlay">
			            <a href="<?php the_permalink(); ?>" class="expand">VIEW ARTICLE</a>
			            <a class="close-overlay hidden">x</a>
			        </div>
			    </div>
			</div>
		

</p>
</div>

<?php endwhile; else : ?>
	<p><?php _e( 'Sorry, no posts matched your criteria.', 'ventoux' ); ?></p>
<?php endif;
		wp_reset_postdata();
		?>

		
	</div><!-- End of row -->
</div><!-- End of wrapper -->
   <?php $myvariable = ob_get_clean();
    return $myvariable;
}
add_shortcode('home_blog_feed', 'ventoux_custom_loop');