<?php $postCollection = $block->getPostCollection(); ?>

            <?php $postCollection->addAttributeToSelect('*')

           ->getSelect()->orderRand(); ?>

            <?php if ($postCollection && $postCollection->getSize()) : ?> 

                <?php 

                $count =0;

                $end = 3;?>
<div class="mostpopular">
<h4>Most Popular<span class="bbb"> Posts</span></h4>
<?php /** @var \Mageplaza\Blog\Model\Post $post */

            foreach ($postCollection as $post) : ?>  

                <?php $count++; ?>   

   				<?php if ($post->getImage()) : ?>

<div class="mostpop"><a href="<?= $post->getUrl() ?>"><img src="<?= $block->resizeImage($post->getImage(), '200x'); ?>" alt="<?= $block->escapeHtml($post->getName()); ?>" alt=""></a>
<h5><a href="<?= $post->getUrl() ?>"><?= $block->escapeHtml($post->getName()); ?></a></h5>
</div>
<!-- <div class="mostpop"><img src="https://varnasol.com/pincho/images/mp1.png" alt="">
<h5><a href="#">The Best Peach Cobbler</a></h5>
</div>
<div class="mostpop"><img src="https://varnasol.com/pincho/images/mp1.png" alt="">
<h5><a href="#">The Best Easy Pasta Salad</a></h5>
</div> -->
<?php endif; ?>   

			<?php if ($count == $end) break; ?>

              <?php endforeach; ?>

</div>
<?php endif; ?> 