How do you remove hard coded thumbnail image dimensions?

Posted by Prem Tiwari | Updated on

Want to remove hard coded thumbnail image dimensions in your WordPress site. There’s a filter on post_thumbnail_html which receives as its argument the full html element representing the post thumbnail image before it’s echoed to the page. You can filter out the dimensions with a bit of regex.

Use following code in your theme’s functions.php file OR in site specific plugin.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers