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
{{ message }}
Repository navigation
Commit 21f2e50
Browse filesBrowse the repository at this point in the historyBrowse files
Give projects opt-in LCP images, sized static images, a low-priority logo, idle JS init, and scroll-free animations so new themes start closer to good CWV scores.
Co-authored-by: Cursor <cursoragent@cursor.com>
Copy file name to clipboardExpand all lines: README.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -194,6 +194,43 @@ You can launch a bundle report with the following command :
194
194
yarn bundle-report
195
195
```
196
196
197
+
## Core Web Vitals
198
+
199
+
### What the theme provides
200
+
201
+
-**LCP image**: pass `'is_lcp' => true` in the settings of `get_the_image()` for the main above-the-fold image (hero, cover). It removes `loading="lazy"` and adds `fetchpriority="high"` and `decoding="sync"`. Use it on one image per page only.
-**Decorative images**: pass `'alt' => ''` to output `alt=""`, so assistive technologies skip the image. Omitting `alt` is not equivalent.
208
+
-**Static theme images** (logos, placeholders, illustrations from `dist/`): use `get_theme_static_image_markup()` / `the_theme_static_image()`. `width` and `height` are read from the file (SVG or raster) to avoid layout shifts (CLS).
-**JS**: `Animation` relies on `IntersectionObserver` (no scroll loop). Use `deferInitialization()` from `src/js/utils` to run non-critical code when the browser is idle (INP).
222
+
223
+
### What each project still has to configure
224
+
225
+
These depend on the hosting, plugins and content, so they are not part of the theme:
226
+
227
+
- Page cache and WP Rocket settings (Remove Unused CSS, defer / delay JS and their exclusions, lazyload exclusions for the LCP image, preconnect hints limited to the third parties loaded early).
228
+
-`robots.txt` (technical and AJAX endpoints) and `Cache-Control` headers for static assets.
229
+
- SEO plugin settings: canonical URLs on custom pagination, structured data duplicates.
230
+
- Fonts: subset files to the weights and glyphs actually used, drop unused files (italics, extra weights).
231
+
- Third-party embeds (videos, forms, webinars): load them on interaction or when they enter the viewport.
232
+
- Plugin assets: dequeue front scripts and styles on pages that do not use them.
0 commit comments