preload_product_page_featured_page_automatic

PHOTO EMBED

Sun Jun 26 2022 19:45:37 GMT+0000 (UTC)

Saved by @evyatargill #undefined

​function preload_product_page_featured_page_automatic() {
    if ( is_product() ){
		$attachment_ids[0] = get_post_thumbnail_id( $product->id );
		$attachment_full = wp_get_attachment_image_src($attachment_ids[0], 'full' );
     	$attachment = wp_get_attachment_image_src($attachment_ids[0], 'woocommerce_single' );
		$attachment_mobile = wp_get_attachment_image_src($attachment_ids[0], 'woo-product-single-image-size-hook' );
echo ''. PHP_EOL .'<!-- Preload Product Page First Featured Image -->'. PHP_EOL .'<link rel="preload" href="' .$attachment[0]. '" as="image">'. PHP_EOL .'<!-- End Preload Product Page First Featured Image -->';	
}
 
}
add_action( 'wp_head', 'preload_product_page_featured_page_automatic');




content_copyCOPY

https://perfectkitchen.co.il/wp-admin/admin.php?page