[wp-trac] [WordPress Trac] #52139: Twenty Twenty-One: Skip loading attribute on featured image instead of loading=eager

WordPress Trac noreply at wordpress.org
Mon Dec 21 14:36:29 UTC 2020


#52139: Twenty Twenty-One: Skip loading attribute on featured image instead of
loading=eager
---------------------------+----------------------
 Reporter:  flixos90       |      Owner:  flixos90
     Type:  defect (bug)   |     Status:  assigned
 Priority:  normal         |  Milestone:  5.7
Component:  Bundled Theme  |    Version:  5.6
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+----------------------
 The new default theme is providing a `loading="eager"` for featured images
 displayed, however this is a discouraged pattern per
 [https://make.wordpress.org/core/2020/07/14/lazy-loading-images-
 in-5-5/#highlighter_166425:~:text=it%20is%20advisable%20to%20skip this
 section]:

 > For example, if an image is placed within the `header.php` template and
 is very likely to be in the initial viewport, it is advisable to skip the
 `loading` attribute for that image.

 To clarify, "skip" means omit the `loading` attribute, not set it to
 "eager". The reason is that specifying "eager" explicitly requires the
 browser to load the image right away rather than leaving control to the
 browser, which means that even in special modes like e.g. Chrome Lite mode
 for slow network connections these images would be forced to load right
 away, causing a potentially worse experience.

 We therefore should remove the `loading` attribute for featured images
 instead of specifying it as "eager".

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52139>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list