Skip to content

Responsive Images on Colleges Grid #174

@jmbarne3

Description

@jmbarne3

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

  1. Update the ACF field to return attachment id instead of the URL.
  2. Update the markup to echo wp_get_attachment_image adding the necessary classes via the $attr argument.

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions