Mặc định khi cài đặt WordPress sẽ có 3 kích thước ảnh được sinh ra.
Thumbnail (150x150px crop)
Medium ( 300 x 300 )
Large ( 1024 x 1024 )
Tuỳ vào yêu cầu sử dụng bạn có thể thay đổi số liệu để phù hợp hơn. Hoặc thêm các size ảnh khác vào wordpress
Còn sau đây là cách bạn xoá toàn bộ các kích thước mặc định đó đi. Thêm đoạn code sau vào file functions.php trong theme của bạn là được
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Remove Default WordPress Image Sizes | |
function svl_remove_default_image_sizes( $sizes) { | |
unset( $sizes['thumbnail']); | |
unset( $sizes['medium']); | |
unset( $sizes['large']); | |
return $sizes; | |
} | |
add_filter('intermediate_image_sizes_advanced', 'svl_remove_default_image_sizes'); |
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.