I'm using the add_image_size(); along with the_post_thumbnail(); from wordpress in my functions.php BUT I want the existing images to be refreshed automatically without having to remove and upload them again. How's that possible?
There are multiple plugins that allow you to regenerate your thumbnails without having to reupload them.
Some of them are:
https://wordpress.org/plugins/regenerate-thumbnails/
https://wordpress.org/plugins/force-regenerate-thumbnails/
These plugins actually take the currently registered image sizes, and regenerate all of your images with these sizes, automatically. So once you make a change to your existing image sizes, or create a new image size, you should simply use one of these plugins to regenerate your images quickly.
Related
I have an up to date install of wordpress and woocommerce using a pretty simple, customized theme.
I recently noticed that woocommerce is not calling thumbnail images for catalog pages, the cart, anywhere.. i hadn't noticed earlier because everything looks OK. For example: the cart displays 32x32px thumbnails, but is merely re-sizing the original image (1000x10000px) down to 32x32 instead of calling a smaller file such as the 150x150px thumbnails. it seems to be doing this anywhere a smaller image is used and my main catalog page is almost 40mb which is ridiculous- it should only weigh 1.5 or 2mb...
if you're feeling frisky, the 40mb catalog page is at superfly5000.com/collections/ (NSFW!!!)
Both woocommerce and wordpress image settings are set to 150x150 and 300x300. WC single product images and WP large size images are set to 0x0 so it will call the original image.
I have regenerated thumbnails and am about to convert all my PNG's to JPG's to save some weight but I really don't want to lose transparencies..
Any ideas??
You have to enable the hard-crop option for thumbnails, more info.
resolved: cool thanks,Vikas, the hard crop wasn't the issue but the snippet at the bottom of the page (https://docs.woothemes.com/document/adding-product-images-and-galleries/#section-4)- manually calling image sizes from the functions.php and regenerating thumbnails apparently did the trick. for some reason WC wasn't using it's own image sizes settings- i don't know why.
When I have images uploaded to Wordpress, there is no way for me to flexibly edit these images. For example, let's say I want to add a colored overlay over an image that has been uploaded to Wordpress. For me to do this, I have to add the overlay to the image, then upload the new modified image to Wordpress. When I am developing a non-Wordpress site, however, all I have to do is link to the photo in the CSS, then using the Image Assets generator, the linked image is changed on the fly. This saves me from having to re-upload photos every time I make a change.
Is there any Photoshop script or plugin, or just a method in general for editing photos without having to re-upload them to Wordpress?
There isn't any script out there that I know of, but if you have access to the wordpress uploads directory via an ftp client, you can edit the originally uploaded file and then use a plugin like Regenerate Thumbnails to update the smaller and automatically generated images.
I upload images around 500x500kb (vary slightly as I resize with a percentage). Wordpress is set to create thumbnails at 150x150.
However, I'm getting 'serve scaled images' errors for two file sizes (dimensions added to end of file title) that are begin resized. One is 272 x 148 and the other is 160x160, yet these sizes aren't in Wordpress media settings. I'm guessing they are theme-specific.
But, as these files appear to be created automatically, how do I set it up so that files are created with the dimensions that are obviously needed by my theme.
And, how does my theme know which version to grab?
Thanks!
Adding new image size
You are looking for Wordpress add_image_size function.
Registers a new image size. This means WordPress will create a copy of the image with the specified dimensions when a new image is uploaded.
In your case:
add_image_size('your-custom-size-name', 272, 148, true);
More info on codex: http://codex.wordpress.org/Function_Reference/add_image_size
New image size in theme
Your theme grabs the image size you ask for with the function get_post_image_thumbnail.
get_the_post_thumbnail($post_id, 'your-custom-size-name');
Resizing existing images
If you've already uploaded some images, you may want to adjust them to the new dimensions automatically. There are few plugins that do so, for example Regenerate thumbnails.
Also, you may want to look to all-in-one tutorial on TutsPlus I've found while googling for the plugin.
I can't see the thumbnail with it's proper regulation. By default, the thumbnail shown 200X300, 600X1200, 600X1024. If i use 600X1200 or 600X1024 it's not show in site properly. But if I use 200X300 then show properly but the resulation is so bad.
http://awesomescreenshot.com/04d2m8gy7a
I would accept that you already have added this image sizes in your functions.php. In order to get the proper image output, you need to regenerate your thumbnails to set the proper thumbnail sizes. Download and install Regenerate Thumbnails and regenerate all you thumbnails. You only need to do this once.
I created a custom post type 'film" and I want to resize it thumbnails to 100x125 px. I uploaded the images in these dimensions, but when I load the page, several images are showed to 86x125.
This is my functions.php
add_theme_support('post-thumbnails';
set_post_thumbnail_size(150, 150, true);
add_image_size('films-thumbnail', 100, 125, true);
And in my archive-films.php I wrote:
the_post_thumbnail('films-thumbnail');
But I say doesnt work for all images, I dont know if its for wordpress error or for markup error.
This is the list. http://goo.gl/Y3LFCq
Thanks in advance.
Download and install Force Regenerate Thumbnails. This properly resize all your thumbnails to the sizes set. It will also delete sizes that is not used in the theme. Another option is to download and install Regenerate Thumbnails. It does exactly the same, but does not delete image sizes that are unneccesary