The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Responsive Thumbnails in WordPress Reply To: Responsive Thumbnails in WordPress

Andy Giesler

suis — for some reason part of jmy1138’s code didn’t get escaped correctly, but I recovered it from the HTML source.

This works for me:

if ( has_post_thumbnail() ) {
    $image_src = wp_get_attachment_image_src( get_post_thumbnail_id(),’thumbnail’ );
     echo '<img width="100%" src="' . $image_src[0] . '">';