Making WordPress.org

Opened 5 years ago

Closed 5 years ago

#5986 closed defect (bug) (fixed)

Improve image markup

Reported by: jonoaldersonwp Owned by: coffee2code
Priority: high Milestone:
Component: Photo Directory Keywords: performance seo
Cc:

Description (last modified by jonoaldersonwp)

Images in grid displays like the one on ​https://wordpress.org/photos/ and ​https://wordpress.org/photos/photo/ and ​https://wordpress.org/photos/author/anariel-design/ should:

  • Use loading="lazy" and decoding="async"
  • Use an srcset attribute, providing multiple w variants, targeting 1x, 1.5x, 2x variations.
  • Use a sizes attribute describing the optimal sizing (optionally using a simplified value of 295px).
  • Use an alt attribute of the image caption.

Change History (4)

#1 @jonoaldersonwp
5 years ago

  • Description modified (diff)

#2 @coffee2code
5 years ago

  • Resolution → fixed
  • Status new → closed

Fixed in [18228-dotorg]:

Photo Directory theme: Improve image markup in grid display.

  • Add loading="lazy" and decoding="async"
  • Add srcset attribute.
  • Add alt attribute with the image caption.
  • Remove use of figcaption since it was always hidden.

Props jonoaldersonwp, coffee2code.
Fixes #5986.

Of the suggestions, I only didn't implement the sizes attribute since the grid images are always rendered at the same dimensions.

#3 @jonoaldersonwp
5 years ago

  • Resolution fixed
  • Status closed → reopened

Can you add height and width attributes then, please? :)
Otherwise, the lazy loading won't work correctly.

#4 @coffee2code
5 years ago

  • Owner set to coffee2code
  • Resolution → fixed
  • Status reopened → closed

In 11461:

Photo Directory: Add 'width' and 'height' attributes to grid images.

Props jonoaldersonwp.
Fixes #5986.

Note: See TracTickets for help on using tickets.