If you upload images via the WordPress image uploader and insert it into your post, it will include the image width and height attribute in the html <img> tag. Here’s what it will look like.
In most cases, this is absolutely alright. However, if you are using a responsive theme or are dealing with responsive web design, the “width” and “height” attribute will be a major roadblock that you need to get rid of.
Here’s how you can do it.
1. Open your theme’s
2. Copy and paste the following code:
3. Save the changes.
That’s it. Next time when you insert image into the post via the WP image uploader, the width and height attribute will no longer be there.