removing image width and height
-
hello all together.
i’m removing the automatic placed width and height information from images, because i want to organize the width of the images by CSS, so my theme can be responsive.
add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10 ); add_filter( 'image_send_to_editor', 'remove_thumbnail_dimensions', 10 ); function remove_thumbnail_dimensions( $html ) { $html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html ); return $html; }
the problem is, this code is removing the
[captio id="XXX"] ... caption text [/caption]
too and i simply dont want that. how have i to modify tis code that the caption information will still be there?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘removing image width and height’ is closed to new replies.