Error 500 End While WordPress Error

Solution:

Looks like the problem is your use of shorttags here: <? instead of <?php

If your server isn’t interpreting these as PHP, php will see the endwhile before it sees the close tags. Change them to “<?php instead of <?.”

“<?php while ( $query->have_posts() && $count != 3) : $query->the_post()?>
<?php $count++; ?>
<div class=”row”>
<div class=”col-xs-12 col-sm-12 col-md-4 col-lg-4″>
<?php the_post_thumbnail(‘medium’); ?>
</div>
<div class=”col-xs-12 col-sm-12 col-md-8 col-lg-8 post-info”>
<h3><a title=”<?php echo get_the_title(); ?>” href=”<?php echo get_permalink(); ?>”><?php the_title(); ?></a></h3>
<time><?php the_date(); ?></time>
<div class=”category”>
<!– <p>Category: <a title=”Posts about <?php get_category_link(get_the_category()[0]->title); ?>” href=”<?php echo get_category_link(get_the_category()[0]->id); ?>”><?php the_category(‘, ‘, ‘single’, get_the_ID()); ?></a></p>–>
</div>
<a title=”<?php echo get_the_title(); ?>” href=”<?php echo get_permalink(); ?>” class=”col-12 btn btn-block btn-info”>Read More..</a>
</div>
</div>
<?php
endwhile; //resetting the page loop
wp_reset_query(); //resetting the page query
?>”