I’m trying to get rid of all predefined Enfold image sizes and setup my own.
So far I’ve been able to remove most of them by adding this into my functions.php :
add_filter( 'avf_modify_thumb_size', 'mwm_enfold_reset_image_sizes', 10, 1 );
function mwm_enfold_reset_image_sizes( $sizes ) {
return null;
}
But there are still those left :
– shop_thumbnail
– shop_catalog
– shop_single
I guess they are declared elsewhere in the theme. Is there a filter that can handle these ?
Thanks
https://kriesi.at/support/topic/enfold-image-sizes-3/#post-1109028
or let some in but redefine the width and height of them:
function custom_modified_thumb_sizes( $size ){
$size['square'] = array('width'=>300, 'height'=>300 );
return $size;
}
add_filter('avf_modify_thumb_size', 'custom_modified_thumb_sizes', 10, 1 );
to set the crop behavior that line looks this way:
array('width'=>300, 'height'=>300 , 'crop' => false);
Thanks Günter, you put me on the right track.
This is my end script for removing all Enfold image sizes :
/* Remove all default Enfold image sizes */
add_filter( 'avf_modify_thumb_size', 'mwm_enfold_remove_image_sizes', 10, 1 );
function mwm_enfold_remove_image_sizes( $sizes ) {
return null;
}
/* Remove all Enfold shop image sizes */
add_filter( 'init', 'mwm_enfold_remove_shop_image_sizes', 10, 1 );
function mwm_enfold_remove_shop_image_sizes( $sizes ) {
remove_image_size( 'shop_thumbnail' );
remove_image_size( 'shop_catalog' );
remove_image_size( 'shop_single' );
}
Hi mike235,
We’re glad that you found the solution, and thanks for sharing it :)
@Guenni007 thanks again for helping out :)
Best regards,
Nikko