Skip to content

Instantly share code, notes, and snippets.

@BFTrick
Created October 30, 2012 19:46
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 BFTrick/3982549 to your computer and use it in GitHub Desktop.
Save BFTrick/3982549 to your computer and use it in GitHub Desktop.
Remove Image & Height Dimensions Using WordPress Filters
//http://speakinginbytes.com/2012/11/responsive-images-in-wordpress/
add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10 );
add_filter( 'the_content', 'remove_thumbnail_dimensions', 10 );
function remove_thumbnail_dimensions( $html ) {
$html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html );
return $html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment