ResponsiveImagesCG / wp-tevko-responsive-images

Fully responsive image plugin for wordpress
449 stars 53 forks source link

Function to output responsive images in themes #233

Closed landwire closed 8 years ago

landwire commented 8 years ago

Hi there, is there a function I can use to output a responsive image by attachment id in a theme? As far as I understood from this (https://make.wordpress.org/core/2015/09/26/responsive-images-feature-plugin-update-2/) it only filters the content for now, correct?

Thanks, Sascha

joemcgill commented 8 years ago

Hi @landwire,

Any image that you create using wp_get_attachment_image() will include srcset and sizes attributes. You can also build your own image markup using wp_get_attachment_image_srcset() and wp_get_attachment_image_sizes().

Cheers, Joe