This is actually the website I'm trying this on:

The very best couple of deals are bigger than 620 width, however the bottom ones are more compact. I attempted to make use of the code below without results. I have Researched around and just found permanent solutions.

<?php the_post_thumbnail( array(620,295) ); ?>

Any assistance is appreciated.

How about placing a around that the setting the above mentioned code after which using CSS to create the width and height? Something similar to this:


.deals img {
 width: 620px;
 max-height: 295px;


<div class="deals"><?php the_post_thumbnail( array(620,295) ); ?></div>

Please try the next code.

$thumbnail_id = get_post_thumbnail_id(get_the_ID());
if (!empty($thumbnail_id))
  $thumbnail = wp_get_attachment_image_src($thumbnail_id, 'full');
  if (count ($thumbnail) >= 3)
    $thumbnail_url = $thumbnail[0];
    $thumbnail_width = $thumbnail[1];
    $thumbnail_height = $thumbnail[2];

    $thumbnail_w = 620;
    $thumbnail_h = floor($thumbnail_height * $thumbnail_w / $thumbnail_width);

if (!empty ($thumbnail_url)): ?>
  <img class="thumbnail" src="<?php echo $thumbnail_url; ?>" alt="<?php the_title_attribute(); ?>"
       width="<?php echo $thumbnail_w; ?>" height="<?php echo $thumbnail_h; ?>" />
<?php endif; ?>