<div class="row section">

    <?php
    $grid = tweaker5_get_featured_content();
	$count = count($grid);
	if ( $count <= 4 ) {
		$grid_class = 'col grid-' . 12/$count;
	} elseif ( $count > 4 ){
		$grid_class = 'col grid-3';
	} ?>
	<?php foreach ($grid as $post): setup_postdata( $post ); ?>
		<div class="<?php echo $grid_class; ?> ">
            <?php if ( has_post_thumbnail() ) { ;?>
                <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( the_title_attribute( 'echo=0' ) ); ?>" ><?php the_post_thumbnail('full', array('alt' => '' )); ?></a>
			<?php } else { ?>
                <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( the_title_attribute( 'echo=0' ) ); ?>" ><img src="<?php echo get_template_directory_uri(); ?>/images/default.jpg" alt="" ></a>
            <?php } ?>
		</div><?php // close .col ?>
	<?php endforeach; ?>
    
</div><?php // close .row ?> 

<?php wp_reset_postdata(); ?>       