Home › Forums › Front-end Issues › Cannot get srcset to output anything › Reply To: Cannot get srcset to output anything
I’m not sure, this is the way I’ve been doing responsive images lately as an example:
$image_tag = '<img src="'.$image[0].'" width="'.$image[1].
'" height="'.$image[2].'" alt="'.$image_alt.
'" class="size-'.$image_size.' wp-image-'.$image_id.'" />';
$image_tag = wp_make_content_images_responsive($image_tag);
The image tag is formatted the same way as images added into content and I just let WP work out all the details.
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.