I have used thumbnail like this in my wordpress theme's one template →
<?php the_post_thumbnail( 'medium' ); ?>
In the browser it is rendering like this →
<img
width="300"
height="220"
src="http://example.com/image-300x220.jpg"
class="attachment-medium size-medium wp-post-image"
alt=""
srcset="
http://example.com/image-300x220.jpg 300w,
http://example.com/image.jpg 640w"
sizes="(max-width: 300px) 100vw, 300px"
>
My first question is how to put height = auto is there any function that can help us to achieve this?
such as responsive-img
In short, I am asking should I control the width through the CSS or WordPress gives some function to do this?