Skip to content

Conversation

@jasperf
Copy link
Contributor

@jasperf jasperf commented Nov 24, 2025

This PR implements comprehensive image optimization for the home page hero block, introducing responsive image sizes and lazy loading controls to improve page load performance. The changes add WordPress responsive image generation with multiple size variations specifically tailored for hero display, while implementing conditional lazy loading that disables it for above-the-fold hero images to optimize Largest Contentful Paint (LCP) metrics. The implementation follows WordPress best practices by leveraging the native wp_get_attachment_image() function with custom size attributes and loading parameters configured through ACF block fields.

Hero Block Image Optimization:

  • Added responsive image size generation in app/setup.php with multiple breakpoint-specific dimensions for hero images
  • Updated HeroBlock.php to include a new disable_lazy_load field allowing editors to control lazy loading behavior per-block
  • Modified the Blade template to use wp_get_attachment_image() with proper sizes attribute and conditional loading parameter based on the lazy load setting

Performance and Core Web Vitals:

  • Implemented loading="eager" option for hero images to prevent lazy loading on above-the-fold content, directly improving LCP scores
  • Added sizes attribute with responsive breakpoints to ensure browsers download appropriately-sized images for each viewport

Documentation:

  • Updated CHANGELOG.md to document the home hero image optimization changes

Files Changed:

@jasperf jasperf merged commit 4dca3e8 into main Nov 24, 2025
2 checks passed
@jasperf jasperf deleted the hero-image-optimization branch November 24, 2025 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants