Tagged: image sizes
-
AuthorPosts
-
September 6, 2015 at 10:41 am #498811
Hi,
My server space was almost full so I started to look for the cause. I’ve found out that when I’m uploading 1 image to my blog, with the size 900×600 px (152 kb), it end up on my server with 17 different sizes!!! From 36×36 px to 900 x 430 px. Total EXTRA used space for 1 image: 556 kb!
(I didn’t check it for the images of my portfolio yet)
I only need the size I upload. I can’t find the cause of all the sizes. Can I change this (put this OFF) anywhere in Enfold or WordPress?
Thanks for your help!
September 6, 2015 at 5:11 pm #498901Hi Ester1234!
You can find those and comment them out around line 117 in the /enfold/functions.php file.
Regards,
ElliottSeptember 8, 2015 at 9:48 pm #500114Hi Elliott,
Thanks for your reply.
I’m using lots of images on my site, so the theme was making very making extra images for all sizes.
I upload all the needed image sizes myself, I don’t want the theme making extra (sizes) images for me. Or isn’t that logical?!
I’ ve tried to delete a part from the code in the functions.php-file, but after that I had an error. I’ ve put the original functions.php-file back.
Can you please tell me which part of the function.php-file I have to change or delete?
Thanks a lot!
September 9, 2015 at 1:14 am #500157Hey!
Try adding this at the very end of your theme / child theme functions.php file:
add_filter('avf_modify_thumb_size', function($sizes) { return array(); });
Cheers!
JosueSeptember 9, 2015 at 11:34 am #500311Thanks Josue,
I’ve added the code.
But when I inlog to WordPress or open my website url I get this error :
Parse error: syntax error, unexpected T_RETURN, expecting T_STRING or T_VARIABLE or ‘$’ in C:\domains\esterammerlaan.nl\wwwroot\wp-content\themes\enfold\functions.php on line 523
September 10, 2015 at 1:08 am #500783Try with this instead:
add_filter('avf_modify_thumb_size', function($sizes) { $sizes = array(); return $sizes; });
September 10, 2015 at 4:02 pm #501110Hi Josue,
Thanks for your information. I’ve added the code. No error this time yeahhhh. :o)
I don’t know what the code is doing exactly, but after adding the code and uploading de function-file I added some new images to my portfolio.
But the theme is still making lots of extra images in different sizes.
For example: I uploaded an image with size 500×700 px to my portfolio, the theme made 16 extra images with sizes from 36×36 to 500×684.
So nothing changed?
September 11, 2015 at 3:34 am #501368Hi!
Please edit the functions.php file then remove this code:
$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
Regenerate the thumbnails after: https://wordpress.org/plugins/force-regenerate-thumbnails/
Note that removing the thumbnails might slow down the website because it has to use the original image for every element on the page.
Cheers!
IsmaelSeptember 19, 2015 at 10:09 am #505905Hi Ismael,
Thanks for your advice.
I edited the function.php and removed the code.
After that, the extra images are still added.
I didn’t regenerate the thumbnails, because the images were still there.
September 20, 2015 at 2:44 am #505999Hi,
Can you please create us a WordPress administrator account? post it here as a private reply.
Regards,
JosueSeptember 20, 2015 at 8:43 pm #506129It’s no problem for me when the theme is creating some extra images in different sizes, when 1 upload when.
But so much extra images (every time 1 upload a new one) is using too much from “my server space”
Thanks for your patience and time!
September 21, 2015 at 10:30 am #506319Thanks for the access, can you please try uploading a new image and check if the images are still being generated?
Regards,
JosueSeptember 23, 2015 at 9:50 pm #508083Hi Josue,
After uploading a new image to my portfolio, 6 new images were made. And after uploading an image for my blog, 5 new images were made. So that’s a great improvement, instead of the 17 extra images!
Thanks a lot for your patience, time and solution!
Regards,
EsterSeptember 23, 2015 at 11:45 pm #508111You are welcome Ester, glad to help :)
Regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.