@davesmith_au, You can exclude a particular image id by using the filter, wp_smush_image
The filter is available from WP Smush version 2.5.2 onwards only, so make sure you’re on the latest version.
Here is an example to use it:
function skip_smush( $smush, $attachment ) {
//Attachment ids that needs to be skipped
if( 116 == $attachment || in_array( $attachment, array(117, 118, 119, 132, 137, 170 ) ) ) {
return false;
}
return $smush;
}
add_filter( 'wp_smush_image', 'skip_smush', '', 2 );
Take a backup of the image, if you’re in doubt.
Cheers
Thanks @umeshsingla, but I’m not sure WHERE you’re suggesting I use this code 🙂 Does it go in my (child) theme’s functions file, or the smuch functions file, or where?
ALSO I am unfamiliar with “attachment ids” – Is this the image’s file name, like “banner6.png” or is it something else? I cannot find image attachment id numbers anywhere on the image attachment page.
-
This reply was modified 9 years, 6 months ago by
davesmith_au.
-
This reply was modified 9 years, 6 months ago by
davesmith_au.
@davesmith_au, You’d need to add the code in your (child) theme’s functions.
About the attachment id, if you click over a image in gird/list view, you can see the attachment id in URL. Attaching a screenshot to help you out with that.
1. In URL – https://monosnap.com/file/5VQhiGJKXskdnFtGeDgfGjzMxQK4aF
2. On hover ( List Mode ) – https://monosnap.com/file/zgTP0U2ffUkPZWPaZQZECg2UjZqmn0
Cheers
Thanks for both answers @umeshsingla you are a good help. On the second one, I feel like a dill! I looked everywhere EXCEPT the obvious place, the browser address bar!
Ah well, the only bad question is the one you don’t ask I guess. Maybe it’ll help someone else out there too!
Cheers, and thanks again.