Code tối ưu ảnh cho website wordpress
Chèn code vào file functions.php giúp tối ưu ảnh cho website
//tối ưu ảnh add_filter( 'image_resize_dimensions', 'tat_crop', 10, 6 ); function tat_crop( $enable, $orig_w, $orig_h, $dest_w, $dest_h, $crop ){ return false; } add_action( 'init', 'tat_image_sizes' ); function tat_image_sizes() { foreach ( get_intermediate_image_sizes() as $size ) { remove_image_size( $size ); } }