0

I'm using WordPress 4.4.2, but am unable to get the new responsive images functionality to appear for the_content.

It works for featured images, just not the_content images.

I have no plugins installed (other than the default which aren't active) and have tried using the themes that come with wordpress (twenty sixteen, twenty fifteen) but WordPress isn't generating the srcset or sizes attributes in the source code.

Is there some setting I have to turn on to get this to work?

  • 1
    Not enough information. What are you actually seeing? What are you expecting to see? There is no setting. – Otto Apr 14 '16 at 0:56
1

I just worked out why it wasn't working.

In order for WordPress to generate the srcset and size attributes for images in the_content, it must have a class associated with it indicating the image attachment id (for example, 'wp-image-41').

This is automatically attached to the image when it is inserted via the editor.

Unfortunately, in my older posts, all this class information has been stripped. Will have to go back through and re-insert the classes :(

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.