<?php
$email = $review['email'];
$hash = md5($email);
$uri = 'http://www.gravatar.com/avatar/' . $hash . '?d=404';
$default = "https://www.somewhere.com/homestar.jpg";
$size = 50;
$headers = @get_headers($uri);
if (!preg_match("|200|", $headers[0])){
$grav_url = "catalog/view/theme/tbchoice/img/comment2.jpg";
} else {
$grav_url = "https://www.gravatar.com/avatar/" . md5( strtolower( trim( $email ) ) ) . "?d=" . urlencode( $default ) . "&s=" . $size;
}
?>
<div class="container">
<?php
$wp_query = new WP_Query();
$wp_query->query('showposts=2&post_type=event'.'&paged='.$paged); ?>
<?php if($wp_query->have_posts()) : ?>
<div class="row">
<?php $i = 0; ?>
<?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
<?php if($i == 2) : ?>
</div>
<div class="row">
<?php $i = 0; ?>
<?php endif; ?>
<div class="col-md-6"><?php the_title(); ?></div>
<?php $i++; ?>
<?php endwhile; ?>
</div>
<?php endif; wp_reset_query(); ?>
</div>