Skip to content

Instantly share code, notes, and snippets.

@waviaei
Created August 27, 2012 10:25
Show Gist options
  • Save waviaei/3487249 to your computer and use it in GitHub Desktop.
Save waviaei/3487249 to your computer and use it in GitHub Desktop.
Strip away all width="" and height="" from <img /> of post thumbnails
function strip_width_height_html( $html ) {
$html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html );
return $html;
}
add_filter ( 'post_thumbnail_html', 'strip_width_height_html');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment