Created
January 20, 2014 22:55
-
-
Save dalethedeveloper/8531053 to your computer and use it in GitHub Desktop.
Remove height= and width= attributes on IMG tags generaged by WordPress :: the_thumbnail() calls.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function strip_img_hwattr($html) { | |
return preg_replace('/(width|height)=\"\d+\"\s/','',$html); | |
} | |
add_filter('post_thumbnail_html','strip_img_hwattr',100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment