Skip to content

Instantly share code, notes, and snippets.

@dalethedeveloper
Created January 20, 2014 22:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dalethedeveloper/8531053 to your computer and use it in GitHub Desktop.
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.
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