Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I know a few people have asked this question previously; however, I think something may have changed recently in the Wordpress update.

I'm building my own responsive theme for my portfolio, and for embedded post images I have added a filter to functions.php to remove the height/width attribute that Wordpress adds to the image automatically. I have used this filter before on other sites therefore I know it should work.

However, no matter what I try I can't get Wordpress to embed the image without the height/width attributes, meaning the image doesn't resize on mobiles/tablets.

Demo for the image in question is here:

http://demo.iamdannygreen.com/cients/dragonfly-pr/

Any help would be greatly appreciated.

Thanks

Danny

share|improve this question

migrated from stackoverflow.com Dec 20 '12 at 17:24

This question came from our site for professional and enthusiast programmers.

    
this was originally a cross-post, after migration now a dupe of this question –  Milo Dec 20 '12 at 17:36

1 Answer 1

Is this through the post thumbnail functions, or TinyMCE?

If it's through the post thumbnail, you should be able to blank out those attributes like this:

the_post_thumbnail('thumbnail', array('height' => '', 'width' => ''));
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.