fix: optimize CHRNX editorial media

This commit is contained in:
chrnx committed 2026-08-12 15:52:53 -05:00
1 parent 55e21bca81
commit c5720b21ca
14 files changed
+252 -46

No files matched your search

+3
View File
@@ -30,6 +30,9 @@ function chrnx_get_topic_portrait_markup( string $topic_slug, string $alt = '',
$decorative = '' === $alt ? ' aria-hidden="true"' : '';
$loading = 'eager' === $loading ? 'eager' : 'lazy';
$priority = 'eager' === $loading ? ' fetchpriority="high"' : '';
if ( 'music-collage' === $topic_slug ) {
$sizes = '(max-width: 599px) 100vw, 720px';
}
$markup = '<picture class="chrnx-responsive-portrait"' . $decorative . '>';
$markup .= '<source type="image/avif" srcset="' . esc_url( $base_uri . '-384.avif' ) . ' 384w, ' . esc_url( $base_uri . '-768.avif' ) . ' 768w" sizes="' . esc_attr( $sizes ) . '">';