Grid post page on WordPress with Bootstrap, the_excerpt(); Problem

The way I tackle this issue is by closing the row every nth column, like so. You basically collect the total number of posts in the current loop then at the end of each loop, increment $i and check whether it’s divisible by two wholly (I’m rubbish at explaining this part).

Example: You could tweak this to if ( $i % 3 == 0 ) if you were wanting rows of 3.

The example below can replace your entire container.

<div class="container">

    <?php query_posts('post_type=post&post_status=publish&posts_per_page=10&paged='. get_query_var('paged')); ?>

    <?php 
    // Get total posts
    $total = $wp_query->post_count;

    // Set indicator to 0;
    $i = 0;
    ?>

    <?php while( have_posts() ): the_post(); ?>

        <?php if ( $i == 0 ) echo '<div class="row">'; ?>

        <div class="col-sm-6" style="margin-bottom: 65px;">

        <p>
            <?php if ( has_post_thumbnail() ) : ?>
                <a href="https://wordpress.stackexchange.com/questions/272613/<?php the_permalink(); ?>"><?php the_post_thumbnail( 'large' ); ?></a>
            <?php endif; ?>
        </p>

        <h3><a href="https://wordpress.stackexchange.com/questions/272613/<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>

        <p>Posted on <?php echo the_time('F jS, Y');?> by <?php the_author_posts_link(); ?> </p>

        <?php the_excerpt(); ?>

        </div><!-- col -->

        <?php $i++; ?>

        <?php
        // if we're at the end close the row
        if ( $i == $total ) { 
            echo '</div>';
        } else {
            /** 
             * Perform modulus calculation to check whether $i / 2 is whole number
             * if true close row and open a new one
             */
            if ( $i % 2 == 0 ) {
                echo '</div><div class="row">';
            }
        }
        ?>

    <?php endwhile; ?>

</div><!-- container -->