media - Disable Responsive Image Sizes crop

I think my question might similar to others.Here is my problem, I want to remove generating wordpress responsive images

I think my question might similar to others.Here is my problem, I want to remove generating wordpress responsive images because I have done image responsive solution with my way. So, I don't wanna save any auto generated images from wordpress in my server.

When I google it, most show how to remove from tag at frontend.

I think my question might similar to others.Here is my problem, I want to remove generating wordpress responsive images because I have done image responsive solution with my way. So, I don't wanna save any auto generated images from wordpress in my server.

When I google it, most show how to remove from tag at frontend.

Share Improve this question asked May 20, 2020 at 14:47 PorPor 4024 silver badges12 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

If you mean you want to only save the original image to the server, and not have WP auto-generate additional sizes, there's a function to remove the additional sizes:

<?php
function wpse_remove_image_sizes() {
    // Remove the WP Core "thumbnail" size
    remove_image_size( 'thumbnail' );
    // Remove a custom image size with the slug "custom-size-name"
    remove_image_size( 'custom-size-name' );
    // Add any other sizes you need to remove -
    // this will depend on your theme and plugins.
}
add_action('init', 'wpse_remove_image_sizes');
?>

Proceed with caution, because many themes and some plugins use these other sizes, particularly the thumbnail.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742415851a4439729.html

相关推荐

  • media - Disable Responsive Image Sizes crop

    I think my question might similar to others.Here is my problem, I want to remove generating wordpress responsive images

    23小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信