Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function to output responsive images in themes #233

Closed
landwire opened this issue Nov 11, 2015 · 1 comment
Closed

Function to output responsive images in themes #233

landwire opened this issue Nov 11, 2015 · 1 comment
Labels

Comments

@landwire
Copy link

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants