Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.