-
AuthorPosts
-
November 22, 2014 at 8:31 pm #356011
Hi guys,
I used to do it like this before I moved to child theme:
/*$avia_config['imgSize']['widget'] = array('width'=>36, 'height'=>36); */
But how can I disable image previews generation in child theme?November 23, 2014 at 8:07 am #356104Hey Speedskater!
Thank you for using Enfold.
Please install this plugin then delete the thumbnails that you don’t need on Settings > Media: https://wordpress.org/plugins/simple-image-sizes/
Cheers!
IsmaelNovember 23, 2014 at 8:31 am #356117Hi, Ismael!
Thanks for your response. But is it possible to do without plugin? I used Force Regenerate Thumbnails plugin to remove thumbnails and /* */ to prevent new thumbnails generation.
Best regards,
EvgenyNovember 24, 2014 at 5:12 am #356470Hi!
Try using this on functions.php:
function avia_change_image_size_array() { global $avia_config; $avia_config['imgSize']['widget'] = array('width'=>36, 'height'=>36); // small preview pics eg sidebar news $avia_config['imgSize']['square'] = array('width'=>180, 'height'=>180); // small image for blogs $avia_config['imgSize']['featured'] = array('width'=>1500, 'height'=>430 ); // images for fullsize pages and fullsize slider $avia_config['imgSize']['featured_large'] = array('width'=>1500, 'height'=>630 ); // images for fullsize pages and fullsize slider $avia_config['imgSize']['extra_large'] = array('width'=>1500, 'height'=>1500 , 'crop' => false); // images for fullscrren slider $avia_config['imgSize']['portfolio'] = array('width'=>495, 'height'=>400 ); // images for portfolio entries (2,3 column) $avia_config['imgSize']['portfolio_small'] = array('width'=>260, 'height'=>185 ); // images for portfolio 4 columns $avia_config['imgSize']['gallery'] = array('width'=>845, 'height'=>684 ); // images for portfolio entries (2,3 column) $avia_config['imgSize']['magazine'] = array('width'=>710, 'height'=>375 ); // images for magazines $avia_config['imgSize']['masonry'] = array('width'=>705, 'height'=>705 , 'crop' => false); // images for fullscreen masonry $avia_config['imgSize']['entry_with_sidebar'] = array('width'=>845, 'height'=>321); // big images for blog and page entries $avia_config['imgSize']['entry_without_sidebar']= array('width'=>1210, 'height'=>423 ); // images for fullsize pages and fullsize slider avia_backend_add_thumbnail_size($avia_config); } add_action( 'init', 'avia_change_image_size_array', 1);
Set the width and height of the thumbnail size that you want to remove to zero (0). If it doesn’t work, please use the plugin.
Regards,
IsmaelNovember 24, 2014 at 3:41 pm #356871Thanks a lot for your help, Ismael, it worked!
I’d like to add some more information for those who want to remove unnecessary thumbnails. There are also thumbnails in config.php file in config-woocommerce folder:
$avia_config['imgSize']['shop_thumbnail'] = array('width'=>120, 'height'=>120); $avia_config['imgSize']['shop_catalog'] = array('width'=>450, 'height'=>450); $avia_config['imgSize']['shop_single'] = array('width'=>450, 'height'=>999, 'crop' => false);
And just one more question for undestanding. Most of my image sizes in my blog (with sidebar) are 1100x773px (3:2 ratio). If I want to make page loading faster for tablets and other small devices is it possible to use thumbnails instead of original images?
For example, I set thumbnail sizes to 845×563, 630×420, 345×230 etc, ratio is kept at 3:2. When I load a page on a device with possibility to see images in the blog with a maximum width 845px, a browser will load thumbnails with size 845px. And when the device can show images with a maximum width between 630 and 845 px, the browser will load and scale 845px. Is it possible or not?November 25, 2014 at 7:54 am #357398Hey!
I don’t think you can serve different thumbnail size for mobile devices unless you created a script specifically for that which will require major modifications on the theme templates and files. For this, you might need to hire a freelance developer. For further modifications, please visit Envato Studio or Werkpress.
Best regards,
IsmaelNovember 25, 2014 at 9:24 am #357412Ok, Ismael, thank you!
Best regards,
Evgeny -
AuthorPosts
- The topic ‘How to disable image previews generation in child theme’ is closed to new replies.