I defined a div which is 200px * 200px for my thumbnails using the code below in my index.php file:
<ul> <?php
$my_query = new WP_Query('showposts=10&cat=3');
while ($my_query->have_posts()): $my_query->the_post(); $do_not_duplicate = $post->ID;?>
<div id="posts">
<div id="post-thumbnail">
<?php the_post_thumbnail( 'post-thumbnail'); ?>
</div>
<div id="post-content">
</div>
<div id="post-tags">
<li>
<a href="https://wordpress.stackexchange.com/questions/270984/<?php the_permalink(); ?>"><?php the_title(); ?></a>
</li>
</div>
</div>
<?php endwhile; ?>
</ul>
And in my functions.php file I have defined the 200px * 200px size for my thumbnail like below:
if (function_exists('add_image_size')){
add_image_size( 'post-thumbnail', 200, 200,true);
}
Up to here, everything is allright but one of my images is not shown correctly; It fits in width but not in height. The actual size of the image is 1920*1080. Besides other images which are 1920*1200, fit correctly both in width and height.
On the other hand, this issue happens only for some images as I have used images frome the same dimentions(1920*1080) and they fit correctly.
I searched a lot to fix this issue but I was unsuccessful, Please help me.
Thanks.