Stop wordpress from hardcoding img width and height attributes

You can get featured image URL and add it to your content manually, eg:

<?php 
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'thumbnail' ); 

if ($image) : ?>
    <img src="https://wordpress.stackexchange.com/questions/29881/<?php echo $image[0]; ?>" alt="" />
<?php endif; ?> 

Leave a Comment