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

<?php

$showPortfolioPosts = get_theme_mod('portfolio_feed_qty');

if (get_theme_mod('portfolio_feed_qty')){
	$args = array('posts_per_page' => $showPortfolioPosts, 'post_type' => 'portfolio',);
} else {
	$args = array('posts_per_page' => 3, 'post_type' => 'portfolio',);

}



$homeFeedPortfolio = new WP_Query( $args );

if ($homeFeedPortfolio->have_posts() ) : 

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


<div class="vf-custom-padding vf-col-<?php if (get_theme_mod('portfolio_column_qty')) {
	echo get_theme_mod('portfolio_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>
<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 PROJECT</a>
			            <a class="close-overlay hidden">x</a>
			        </div>
			    </div>
			</div>
</p>
</div>

<?php endwhile; else : ?>
	<p><?php _e( 'Sorry, you have no portfolio items to display.', '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_portfolio_feed', 'ventoux_custom_portfolio_loop');