I think wp_get_attachment_srcset() is what you are looking for.
$srcset = wp_get_attachment_image_srcset( $image['id'], array( 100, 100 ) );
Now you can escape the HTML and use it in your code.
<img src="https://wordpress.stackexchange.com/questions/276972/PATH HERE" srcset="https://wordpress.stackexchange.com/<?php echo esc_attr( $srcset ); ?>">
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
- 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
- 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?
- How do I get the avatar URL instead of an HTML IMG tag when using get_avatar?
- Image Upload from URL
- Is it possible set a featured image with external image URL
- Overide Gallery Default Link to Settings
- How can I determine if a post has an image attachment?
- replace wp_get_attachment_image with my own function
- Disable WordPress Big Image Size Scaling
- Hook for saving an image after editing
- How to store media files in subdomain
- Rename image during upload using date and time stamp?
- Get author ID with attachment ID
- Show Post Excerpt in Image Attachement
- WP 3.4 has missing photo data
- How to add image id class?
- wp_get_attachment_url with specific image_size?
- Get meta data from image
- Shortcode for a link and thumbnail
- Bulk edit Gutenberg single images to change from linking to media file to attachment page
- In Wordress one author can not see the other’s author uploaded images through media library
- How to add missing dimensions to all images to avoid cls?
- Prevent Image Pasting in RichText Component
- Why are images created by WP larger than the original uploaded image?
- Default Image Link Type Setting not Working
- Replace image caption with its title and description
- Removing featured image from gallery?
- Where is the right place to store custom images?
- Load Gallery Images with Title on Homepage BX Slider
- Resize images in batch
- Advice on image heavy site, compression and slow page loads
- Blurry images when using add_image_size with crop
- Auto delete pictures in media library by age
- How to get image URL from media_sideload_image?
- Can’t get text to wrap around image
- Allow SVG in WP step by step
- Convert featured images into “product images”
- Having an issue in compressing Images in wordpress site
- Word press cutting sliding images – not displaying the entire image
- Image links broken / “DNS Update Required” message
- Convert multiple image blocks to gallery block in Gutenberg?
- Image sizes reset when changing theme
- Custom Background for each page and post
- How can the alt be added to this wooCommerce category image?
- Delete images of a particular size
- Images not rendering
- Add category description to list of category with taxonomy image
- How do I get the URL of only the first picture in a WordPress post?
- Images getting corrupt automatically
- Thumbnail size keeps resetting automatically
- WordPress Site Broken and it gives Headers Already sent error
- How to disable trackbacks and pings on Images?
- Allow unregistered users to post embeded images from other sites in comments