Registers a new image size. This means that WordPress will create a copy of the Featured Image (formerly known as post thumbnail) with the specified dimensions when you upload a new image.

learn more… | top users | synonyms

11
votes
3answers
6k views

How can I make add_image_size() crop from the top?

I have a series of posts, all with featured images, but I need to be able to customise the crop top right corner. In this instance, I need them to be cropped from top right, but it would be useful to ...
7
votes
7answers
4k views

How to generate thumbnails when needed only?

I have 1000 images. How can i make wordpress to generate thumb only when needed. For example home slider will only use 10 images i dont want the other 1000 images have that thumbnail generated as its ...
7
votes
4answers
457 views

Add image size if page template

I'm building a members website with WordPress Multisite. Is it possible to restrict how many images are being generated depending on the selected template? I have tried the following lines of code ...
6
votes
1answer
696 views

Changing JPEG compression depending on image size

Short. I want ''large' images compressed by 90%, and 'medium' to be by 60%. Has many af you know, sometimes larger images suffer from high compression, but other small images don't. This function ...
5
votes
2answers
1k views

New image size version only for the Featured Image file

I'm worried about too many files created when adding a new image size. All uploaded files will generate the new size, I need a specific image size only for the file set as Fetured image, is there ...
5
votes
2answers
5k views

How to scale up featured post thumbnail?

The situation is this: I'm using Video Thumbnails plugin to automatically get and set youtube/vimeo thumbnails as post featured image. The problem is that default youtube/vimeo thumbnail sizes are ...
2
votes
2answers
2k views

remove or update add_image_size

I'm working on a theme that has a number of image sizes defined correctly using: add_image_size( 'name', 500, 200, true ); I would like to override these defined sizes from the child theme: ...
0
votes
1answer
641 views

Add suffix to filename of uploaded images

I registered 3 custom image sizes (Double sized, for retina displays) with add_image_size: thumbnail@2x, medium@2x and large@2x. function retina_image_sizes() { $retina_sizes = array( ...
11
votes
4answers
3k views

add_image_size() for specific Post Types

set_post_thumbnail_size( 80, 80, true ); // true for all post types Suppose I have two post types in play on my blog: Post, Video and Product. I may want a 80x80 image size for my posts, but 100x100 ...
1
vote
1answer
345 views

Add custom image sizes to media uploader

I want to add custom image sizes to the media uploader: In order to do this, I use the following code (comments are there for convenience): // this function adds the custom image sizes to the ...
2
votes
1answer
2k views

How to create thumbnails with a fixed width, so all of them will have the same width?

right now, a thumbnail will be either 150px in height or in width, depending if it's landscape or portrait. Is there a way to make them always the same width and scale them in height accordingly, ...
1
vote
3answers
237 views

Thumbnail with different sizes

I want make all my blog thumbs the size of 227x133. I need images width have 100% (for responsive design). Some images have width greater than the other and vice versa. I'm using this code to show ...
1
vote
1answer
169 views

Custom image size not selectable in uploader

I want to add a custom image size for each image, that is uploaded into posts (via the uploader). I found code-examples on several websites, but somehow they just don't work for me. This is (the ...
0
votes
1answer
277 views

Get the size (size in Kb or MB) of an featured image?

I need to display some featured image info on post page. Among other info I need to display file size of image (featured image of post). I tried this function inside single.php. <?php function ...
0
votes
1answer
296 views

Display featured image file size, extension, filename, type, orientation?

How to display some information of featured image in post. I need to display: 1. a. Image file size (in kb or MB) b. Image type (.jpg,.gif...), c. Bare image name, with and/or without image ...
0
votes
2answers
519 views

How to get image name, mime type, width, height, file size from post custom field?

What I need is some function to echo file name of image used in post like "image-file-name.jpg", or just "image-file-name". Also it would be great to be able to have even more information about image ...