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 🙁
Related Posts:
- How do I disable responsive images in WP 4.4?
- WP 4.4. responsive images browser choosing the “wrong” one
- How to insert pictures without hard coded dimensions?
- Making WordPress Gallery (.gallery-item) Responsive?
- WP 4.4 aspect ratio with responsive image
- How can I serve different images depending on screen size with wordpress
- add data-attribute to all images inside the_content()
- How to Make WordPress Default gallery responsive on mobile?
- Responsive background images added inline
- Responsive Images – Add srcset attributes to custom Images Function
- Get a list of all image sizes that match aspect ratio of original one
- How to exclude an image size from the WordPress srcset
- Responsive Images Resizing Images
- Featured image (responsive) above content is too small after update to WordPress 4.4
- How to display a different image size for mobile
- WP Responsive images – upload custom image sizes
- Fuzzy Images in WordPress 4.4
- Removing height and width from images with a caption
- Extracting gallery images in WordPress 3.5 on index.php
- How to create ‘Local’ filters for WordPress srcset sizes in template parts?
- Multiple amp-image overlays. How to properly do this in wordpress?
- Fallback for missing srcset images
- max_srcset_image_width doesn’t work as intended
- Using SRCSET with Images and Featured Images
- Omit image captions from get_the_content()
- Understanding WordPress image sizes and responsive images
- Custom responsive ‘featured image’ sizes
- One of my image sizes isn’t showing up in srcset
- How to stop WordPress from completely overriding my tags in my templates?
- Adding srcset to an image in ajax
- Serve different images per screen size and cache possible?
- Disable Media File Image Link On Mobile Devices
- All 3?: Responsive resizing of images + image width of actual image for small images + max-width for all larger images
- Why does WordPress list all image sizes in srcset even if they’re larger?
- How to remove image size inline style in article and include caption
- Responsive header image
- What’s are some best practices for responsive images (e.g. for section headers)?
- How to get title of images in post content
- WordPress Responsive Image ( srcset ) not work properly
- Responsive Images – Defining
- Decide how Hero image appears on mobile
- Responsive Featured Images Not Working
- Responsive images with srcset
- Getting extra image links in code with wp_get_attachment_image
- built-in responsive images in content – do I need to add anything to functions.php?
- Why do images inserted in the post content via the_content() go off the max-width?
- Responsive images in Bootstrap 4 slider
- WordPress not choosing the right image from srcset
- Responsive Images in WordPress
- How to best adjust images to a max content width of 490px?
- Filter the_content() to add custom figure tags
- Removing image dimensions from `the_content`
- Show uploaded images in full size
- Is there a good way to use CMS images with CSS
- How to access & display images from a post without textual content ( and vice versa) according to best wordpress practices
- Remove one srcset entry from wp_get_attachment_image
- Generate / attach Image srcsets from ACF Image Field
- remove or update add_image_size
- Get attachment ID of author_meta image – Attachment Metadata
- Black and White thumbnails
- Alter image output in content
- How can I remove the image attachment ALT field?
- Change html structure of all img tags in WordPress
- Insert image in comment reply
- Randomly add a ‘ul’ list of images
- Include photos in WordPress blog posts without uploading to Media Library
- Thumbnails are bigger in size than the original image
- The the post id from image id
- function to show only featured image of the posts
- Image resize depending on orientation?
- Featured images not displaying at full resolution
- Check if the image exists in WordPress media library
- Faster way to put images into a blog post by using Add Media dialog
- Retrieve an array of image URLs that belong to a gallery
- How can I change get_the_post_thumbnail to make 100% width image?
- Native gallery sorting is ignored
- Using Jetpack carousel w/o creating a gallery [closed]
- removing the featured image from the post
- Dynamic image crop in WP 3.0+?
- What can i do add title to ‘large’ image?
- WordPress cutting images size
- limit number of images shown from gallery
- Alter the image used for a user who has not uploaded a custom image yet
- Allow a specific user role I have created to only upload one image to his media library
- how to regenerate webp et-pb-portfolio-image
- How do I avoid color distortion of uploaded images?
- Where to put code that customizes API
- When upload a PNG a noise appears in the thumbnails
- How to auto add image caption from image alt?
- Get “Image CSS Class” value from the Advanced Options section
- After reinstalling wordpress images do not appear in posts?
- Show images from TEXT section on PAGE wordpress
- Where to add my code to auto attach images to existing products
- If file exists with page slug name show image else nothing
- How can I use images that are on the server locally?
- Image filter works on attachement pages but not posts. I can’t get the image ID
- Paginate Gallery [closed]
- WordPress: Preload next post images
- Why is inline CSS added to images automatically? [closed]
- Profile Image displaying on Wrong side of WordPress Navigation Menu