Support » Fixing WordPress » get_the_post_thumbnail(get_the_ID(),'medium') WP4.4 issue with srcset

  • I have the same issue. The image is breaking in general about WP4.4 my srcset attribute is combining url and directory in the latest attributes.

    <img width="200" height="200" src="http://domain.com/wp-content/uploads/2015/11/image.png" class="attachment-medium size-medium wp-post-image" alt="image description" srcset="http://domain.dev.designcompany.com/wp-content/uploads//media/DriveD/www/www.domain.dev/wp-content/uploads/2015/09/image-80x80.png 80w, http://domain.dev.designcompany.com/wp-content/uploads//media/DriveD/www/www.domain.dev/wp-content/uploads/2015/09/image.png 200w" sizes="(max-width: 200px) 100vw, 200px">

    This results in a broken image.

Viewing 1 replies (of 1 total)
  • If anyone else has this issue it is an alternative to use this:

    $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), 'medium' );

    You can then use the array to output an image tag.

Viewing 1 replies (of 1 total)
  • The topic ‘get_the_post_thumbnail(get_the_ID(),'medium') WP4.4 issue with srcset’ is closed to new replies.