The issue I was having was with some conflicting code I had in my functions file (see below). I usually use this code to remove width/height attributes from being hard-coded into the element in the content area. Removing these somehow appears to mess up the new responsive image implementation in WordPress though. As soon as I removed this code, the responsive images appear to be working as expected.
Conflicting Code
// Remove Width & Height Attributes from Inserted Images
add_filter( 'post_thumbnail_html', 'remove_width_attribute', 10 );
add_filter( 'image_send_to_editor', 'remove_width_attribute', 10 );
function remove_width_attribute( $html ) {
$html = preg_replace( '/(width|height)="\d*"\s/', "", $html );
return $html;
}
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
- 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
- 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
- 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
- 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
- the_content not showing responsive image attributes srcset or sizes
- 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?
- Responsive header image
- What’s are some best practices for responsive images (e.g. for section headers)?
- 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?
- Responsive images in Bootstrap 4 slider
- WordPress not choosing the right image from srcset
- Responsive Images in WordPress
- Is there a good way to use CMS images with CSS
- Remove one srcset entry from wp_get_attachment_image
- Generate / attach Image srcsets from ACF Image Field
- Remove srcset thumbnail attribute for products in the WooCommerce shopping cart
- wp_get_attachment_image with custom size not rendering possible 2x srcset image
- medium_large image size not displaying properly on the frontend?
- Custom header tiling?
- Images showing in editor but not in post [closed]
- Why are featured images sometimes cropped, and sometimes not
- Display an icon with get_post_meta?
- Include WooCommerce 2’s prettyphoto scripts on all site pages
- Change Responsive Images Maximum Width of 1600px
- Where do I locate theme image files
- Help with resizing of featured images on WooCommerce homepage
- How to set uploaded image as featured image wordpress
- Random background image showing on website per click/load
- Why WordPress suddenly changed sizes of thumbnails?
- How to force WordPress to upscale images?
- Image text wrap not working properly on frontend
- Number of Style for Image Added into Post
- How can i add a section of category image upload during adding of category in wp admin area?
- remove enclosure url from feed
- Show last 12 uploaded images on home page, but only from posts
- How to change the value “uploaded to” in the media library (WordPress 4.0)
- Thumbnails different sizes
- What exactly is the description field when uploading an image?
- Fancybox just loading small white square
- Failed to load resource:404 image
- Link to full-size image for subscriber only
- Slidedeck Pro WordPress Image Size
- Thumbnail and image management
- Change Image Size option in the settings in bulk
- Profile image does not upload
- Allow wp media library to check already selected images displayed in div
- How is called this thumbnail slider feature
- Rebuilding core image block
- Custom image size with srcset
- How to get title of images in post content
- Import images from old WordPress site into new site
- WordPress 5: including larger thumbnail image sizes in srcset than I have set
- Use wget to find used images
- Widget media uploader doesn’t opens after widget save
- How to source control manage site images
- Server peek by Own-IP-Calls?
- How to display image thumbnails on the search results page?
- How to modify images during upload
- Change Featured Image Size of the Post
- Reduce Mobile Image upload size (wordpress)
- Surround uploaded image link with div
- Check if post has image
- How do I mitigate the forward slash problem for URLs of images after a WP migration?
- WordPress file browser
- how do i update version for super skeleton
- I tried to move the featured image below the paragraphs but now it is displaying twice
- How to make Media Library files private?
- How to add embed image in comments?
- How do I link an image in a svg file in wordpress?