-
-
Save Falcornus/b05545a8d95c81887bafdb6678864208 to your computer and use it in GitHub Desktop.
the_post_thumbnail() without size
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
add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10, 3 ); | |
function remove_thumbnail_dimensions( $html, $post_id, $post_image_id ) { | |
$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