For reference, this is the code that follows the above query:
if ( $r->have_posts() ) :
?>
<?php print_r ($r); echo wp_kses_post( $args['before_widget'] ); ?>
<?php
if ( $title ) {
echo wp_kses_post( $args['before_title'] . $title . $args['after_title'] );
}
?>
<div class="posts-grid">
<div class="row">
<?php while ( $r->have_posts() ) : $r->the_post(); ?>
<div class="col-md-4 col-sm-6">
<?php get_template_part( 'content', get_post_format() ); ?>
</div>
<?php endwhile; ?>
</div>
</div>
<?php echo wp_kses_post( $args['after_widget'] ); ?>
<?php
wp_reset_postdata();
endif;