In a custom template, i'd like to have the images to be responsive.

I'm using the following code to achieve this:

wp_get_attachment_image($imageID, $size, false, array( 'class' => 'lazyload image-100p', 'data-sizes' => 'auto' ) );

The problem now is that the srcset and the sizes are only containing one image size.

enter image description here

Now my question is how to get the other breakpoints into it.

Kind regards


  • Just use CSS file. – Laxmana Feb 22 '17 at 11:42
  • google page speed says: NO ;) – themca Feb 22 '17 at 11:47
  • Really google says not to use a css file at all ? Come on :) – Laxmana Feb 22 '17 at 11:48
  • hahah google page speed says "no" to img {display:block; widht:100%;} :P – themca Feb 22 '17 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.