EDIT 2
I have tested your code, and it does break my sidebar content. I have modified your code to the code below. It does work as expected, only posts from the last thirty are retrieved according to the fact that it has post thumbnails and ordered by highest post count. I am also testing this on localhost. One other thing that you need to take note of, you have to have Wordpress 3.9+ for this to work
You don't have to specify a value when using the 'EXISTS' or 'NOT EXISTS' comparisons in WordPress 3.9 and up.
<?php if (is_home()) : ?>
<section class="featured-posts clear">
<?php
function filter_where($where = '') {
//posts in the last 30 days
$where .= " AND post_date > '" . date('Y-m-d', strtotime('-30 days')) . "'";
return $where;
}
add_filter('posts_where', 'filter_where');
$args = array(
'order' => 'DESC',
'posts_per_page' => 20,
'meta_key' => 'post_views_count',
'orderby' => 'meta_value_num',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'post_views_count',
'compare' => 'EXISTS'
),
array(
'key' => '_thumbnail_id',
'compare' => 'EXISTS'
),
),
);
$popularPosts = new WP_Query( $args );
remove_filter('posts_where', 'filter_where');
$counter = 1; ?>
<?php while ($popularPosts->have_posts() ) : $popularPosts->the_post(); ?>
<article class="box-<?php echo $counter++; ?>">
<a href=" <?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_post_thumbnail(); ?>
<span><?php the_title(); ?></span>
</a>
</article>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
</section>
<?php endif; // is_home ?>