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 badges1 Answer
Reset to default 0If 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
评论列表(0条)