Die folgenden Codezeilen in der functions.php verhindern das automatische Einfügen von den height and width Angaben eines Bildes:
add_filter( 'post_thumbnail_html', 'remove_wps_width_attribute', 10 );
add_filter( 'image_send_to_editor', 'remove_wps_width_attribute', 10 );
function remove_wps_width_attribute( $html ) {
$html = preg_replace( '/(width|height)="d*"s/', "", $html );
return $html;
}
Quelle: wpsnipp.com


Schreibe einen Kommentar