Home › Forums › Front-end Issues › Repeater Responsive Images › Reply To: Repeater Responsive Images
Scorch,
I don’t know if you figured this one out yet, but there is an amazing plugin called ‘RICG Responsive images’. And that plugin works great with ACF.
After installing the plugin, all you have to do in your template is:
$image = get_field('your-image-field');
$size = 'medium'; // (thumbnail, medium, large, full or custom size)
if( $image ) {
echo wp_get_attachment_image( $image, $size );
}
(Make sure to set the return value of your image field in ACF to ‘Image ID’.)
This code returns the appropriate <img />
tag including all parameters you need (srcset).
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.