You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Update the colleges grid to use wp_get_attachment_image and configure the function to appropriately spit out the correct classes.
Why it's Important
This will allow the built-in responsive image functions run on the images, adding srcsets and sizes attributes to the images.
Alternatives
Calling the wp_make_content_images_responsive function directly won't really work here as it only works if the wp-image-<attachment_id> class is present in the image class attribute.
Possible Implementation
Update the ACF field to return attachment id instead of the URL.
Update the markup to echo wp_get_attachment_image adding the necessary classes via the $attr argument.
The text was updated successfully, but these errors were encountered:
Description
Update the colleges grid to use
wp_get_attachment_image
and configure the function to appropriately spit out the correct classes.Why it's Important
This will allow the built-in responsive image functions run on the images, adding srcsets and sizes attributes to the images.
Alternatives
Calling the
wp_make_content_images_responsive
function directly won't really work here as it only works if thewp-image-<attachment_id>
class is present in the imageclass
attribute.Possible Implementation
wp_get_attachment_image
adding the necessary classes via the$attr
argument.The text was updated successfully, but these errors were encountered: