<div class="fwp-grid">
<?php while ( have_posts() ) : the_post(); ?>
<div class="fwp-grid-col">
<?php if ( has_post_thumbnail() ) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail(); ?></a>
<?php endif; ?>
<?php the_title( '<h3><a href="' . esc_url( get_the_permalink() ) . '">', '</a></h3>' ); ?>
</div>
<?php endwhile; ?>
</div>