diff --git a/2026-04-19_17-14-30.png b/2026-04-19_17-14-30.png new file mode 100644 index 00000000..8dbc00fa Binary files /dev/null and b/2026-04-19_17-14-30.png differ diff --git a/2026-04-19_17-30-11.png b/2026-04-19_17-30-11.png new file mode 100644 index 00000000..5a5c4f0b Binary files /dev/null and b/2026-04-19_17-30-11.png differ diff --git a/wp-content/themes/twentytwentyfour/functions.php b/wp-content/themes/twentytwentyfour/functions.php index 22d3e6be..0aee26e5 100644 --- a/wp-content/themes/twentytwentyfour/functions.php +++ b/wp-content/themes/twentytwentyfour/functions.php @@ -470,7 +470,7 @@ function twentytwentyfour_test1_assets() { wp_enqueue_style( 'twentytwentyfour-test1-fonts', - 'https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700;800&display=swap', + 'https://fonts.googleapis.com/css2?family=Manrope:wght@400;700&display=swap', array(), null ); @@ -546,6 +546,39 @@ function twentytwentyfour_test1_assets() { } add_action( 'wp_enqueue_scripts', 'twentytwentyfour_test1_assets', 100 ); +/** + * Trim non-critical WooCommerce frontend assets on the custom homepage. + * + * @since Twenty Twenty-Four 1.0 + * @return void + */ +function twentytwentyfour_optimize_front_page_assets() { + if ( is_admin() || ! is_front_page() ) { + return; + } + + $style_handles = array( + 'woocommerce-layout', + 'woocommerce-smallscreen', + 'woocommerce-general', + 'woocommerce-blocktheme', + 'wc-blocks-style', + ); + + foreach ( $style_handles as $handle ) { + wp_dequeue_style( $handle ); + } + + wp_deregister_script( 'jquery-migrate' ); + + global $wp_scripts; + + if ( $wp_scripts instanceof WP_Scripts && isset( $wp_scripts->registered['jquery'] ) ) { + $wp_scripts->registered['jquery']->deps = array_diff( $wp_scripts->registered['jquery']->deps, array( 'jquery-migrate' ) ); + } +} +add_action( 'wp_enqueue_scripts', 'twentytwentyfour_optimize_front_page_assets', 120 ); + /** * Send a formatted message to Telegram. * @@ -757,7 +790,7 @@ function twentytwentyfour_test1_shared_shell_assets() { wp_enqueue_style( 'twentytwentyfour-test1-fonts', - 'https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700;800&display=swap', + 'https://fonts.googleapis.com/css2?family=Manrope:wght@400;700&display=swap', array(), null );