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 ...
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 ...
10
votes
2answers
1k views

How can you set maximum width for original images?

Case: I have a client that doesn't know much about the digital world. However what she does know is how to get the photo's from her camera on to the computer and in WordPress. However she doesn't know ...
8
votes
1answer
2k views

Set default image sizes in WordPress to hard crop

How do I set the medium and large images sizes in WP to hard crop? In my theme I can set the thumbnail size to hard crop using this: add_theme_support('post-thumbnails'); set_post_thumbnail_size( ...
7
votes
4answers
392 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
3answers
9k views

Add new image size to media uploader so users can insert into post?

I would like to create an additional size for uploaded images which my users can then "insert into post". I understand that add_image_size() will add a new image size which I can use in my theme, but ...
6
votes
1answer
658 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 ...
6
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 ...
6
votes
2answers
1k views

Remove images (files) that were generated when using add_image_size()

I have added an image size using this: add_image_size('property-featured', 484, 393, true); It's worked very well for the past year and has generated about 1GB of images in that size, but this ...
6
votes
7answers
782 views

Show two different sized featured images on homepage

I would like to have two different sized featured images on my homepage. I currently have all featured images set to 280x200. I would like to have SOME posts on the home page display a larger ...
5
votes
1answer
790 views

How to add multiple image sizes of the same size with add_image_size

I'm using a grayscale filter on all uploaded images in my WordPress installation. However I want both the gray scaled image and the colored image in my website (colored on hover). The way I tried to ...
5
votes
2answers
991 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 ...
4
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 ...
4
votes
1answer
735 views

How to resize images in wordpress without adding any compression or changing the color profile of the images, possible?

As you can guess from the title, Im looking for a solution that allows me to alter the way Wordpress processes/saves its newly created images according to the media settings in the dashboard. This is ...
3
votes
3answers
4k views

set_post_thumbnail_size in percent, not pixels?

I've created a new custom post type and I need the post thumbnails or featured images generated by the get_the_post_thumbnail() function to be set in percent, rather than pixels, as I'm using a fluid ...
3
votes
3answers
2k views

add_image_size() zoom-crop

I've set up a bunch of additional image sizes in my functions.php theme file, with the crop parameter set to true. However, the images are resized but not cropped. if ...
3
votes
2answers
465 views

add_image_size creating lots of images (of various sizes)

I wonder if its a good idea to use add_image_size or is it just a convinence feature. I say this as I think add_image_size creates images of various sizes regardless of what the usage if the image ...
3
votes
1answer
58 views

Confused about image sizing business in Wordpress

I'm creating my first Wordpress theme and I've got everything working fine, and by following this tutorial and few others I've understood how to add custom image sizes by using add_image_size() ...
3
votes
1answer
235 views

Define Wordpress image size in img tag

Is there a way to output a image in a pre-determined size (Ie; using add_image_size) using just the img tag? For example, how can I make sure that the image that is echoed using this tag is the exact ...
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: ...
2
votes
2answers
1k views

How to scale up post thumbnails/featured image?

Is there a way to scale up post thumbnails on Wordpress? On a featured div I want a post thumbnail/featured image with 584×348 px. When I upload a smaller image as a featured image on a post, it ...
2
votes
2answers
606 views

How to set the width and height rule for featured image

I want to know how to make rules to re-size the images for featured image? I am uploading an image in featured image section but it is not cropping the images in exact width and height for all the ...
2
votes
3answers
674 views

add_image_size and iPad Retina Display (high pixel density)

i was just wondering if anyone has come up with or thought about a solution for inline images and the new iPad coming out. i would love to use a combination of add_image_size and this jQuery Script ...
2
votes
2answers
144 views

Use image url with add_image_size

I am looking for a way to use an image url with the WordPress function add_image_size, I have already setup an image size called 'custom-thumb' For example, instead of... the_post_thumbnail( ...
2
votes
1answer
992 views

Can a thumbnail of an animated gif be animated?

I have an animated gif I want to show in two places, having two different sizes. I am creating two sizes in my functions.php, using add_image_size( 'small-feature', 500, 300 ); add_image_size( ...
2
votes
3answers
2k views

Getting custom-sized featured image's URL?

I'm adding additional image sizes to my theme: functions.php add_image_size( 'my-thumbnails', 122, 122, true ); I used to get thumbnails URL like this: ...
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, ...
2
votes
1answer
36 views

Custom image sizes only for thumbnails

I solve one problem, I use in template several different sizes of images (add_image_size), but I use them only for thumbnails, it is completely unnecessary to create these sizes for each image ...
2
votes
2answers
1k views

add_image_size for post type

I currently have this in my functions file, which works as expected: // Enable Post Thumbnails add_theme_support('post-thumbnails'); // Custom Thumbnail Sizes add_image_size( 'square-small-thumb', ...
1
vote
1answer
2k views

How to scale image with equal width and height without distortion?

I have a section on my frontpage that querys through recent posts and grabs the title and thumbnail of each. In my functions.php, I've specified a width and height for the thumbnail using: ...
1
vote
2answers
3k views

How to prevent upload of a multiple sizes of images

on my theme, i found this script add_image_size( 'slider', 464, 249, true ); add_image_size( 'fmenu', 306, 280, true ); add_image_size( 'teamthumb', 138, 207, true ); add_image_size( 'imlink', 286, ...
1
vote
1answer
100 views

Confusion about arguments sent to add_image_size

Looking at the documentation for Cropping Thumbnails when adding new image-sizes makes me confused. Set the image size by cropping the image and defining a crop position: add_image_size( ...
1
vote
3answers
227 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
187 views

Wordpress Image Editor doesn't update thumbs specified with `add_image_size()`

The title somewhat explains the issue. I have a template using bones. I am not sure if this matters or not. http://themble.com/bones/ In the functions.php file we add some additional thumbnail size ...
1
vote
1answer
606 views

How to get custom image sizes into media uploader dropdown?

I searched net to solve the problem with images size uploaded from media. But not even one worked to me. When I try to insert images from the media into post it does not show my custom image size 608 ...
1
vote
1answer
183 views

Custom image size not regenerating when image editted

I have a custom image size at 200x150 that works fine in a plugin I'm working on. Uploading new files is no problem but when I edit an image, the default image sizes get regenerated but my custom ...
1
vote
1answer
330 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 ...
1
vote
1answer
376 views

Auto resize images after adding a new size

I have added a new (small) image size to the theme we develop: add_image_size('small', 160, 91, TRUE); How to automatically generate these small images (exactly of the specified size) for every ...
1
vote
1answer
1k views

Get post attachment images dimension and use in embed code

I am trying to make things work like where any post attachment image will generate embed code automatically. Example: If I upload and add two images 1. 250x150 2. 600 x 160 and insert into post. Now ...
1
vote
2answers
1k views

Combining media queries with image sizes

I have a set of image sizes for WordPress that look like this: add_image_size('1039', 1039, 697); add_image_size('960', 960, 644); add_image_size('800', 800, 537); add_image_size('768', 768, 515); ...
1
vote
2answers
320 views

thumbnails are getting clipped down, want to resize instead

I am working on a pre-built theme, and it is clipping the thumbs off. It looks like it is happening in functions.php. I already checked the media and it is not checked. I want to achieve a resizing ...
1
vote
1answer
77 views

Wrong image dimensions in Insert Media after add_image_size()

I am creating a custom Wordpress theme based on the Bones WP theme. I'm having a problem where an image size that I've specified in functions.php using add_image_size() isn't showing the correct width ...
1
vote
3answers
294 views

Define size for `get_post_gallery_images`, they seem to have been resized to 150x150

I'm using get_post_gallery_images and it's spitting images out as 150x150. It doesn't look like it takes a size parameter, so I assumed it would just spit out the largest image or preferably one of my ...
1
vote
1answer
47 views

Large image size stuck on old value, even for new images

I changed the 'Large' image size in Settings > Media > Image Sizes from the default to max-width 586px. That was wrong, so I changed it back to max-width 1024px. However, the smaller size seems to ...
1
vote
2answers
310 views

Image rotation fails to regenerate custom sized thumbnail

I'm using custom image dimensions in functions.php like this: add_image_size( 'custom-size-thumbnail', 120, 120, true ); I uploaded some pictures with wrong orientation, so I used "edit" options to ...
1
vote
1answer
385 views

Image Uploader API

I want to create a widget for my theme that will let me upload an image to WP and crop it to a certain size. Can anyone point me to the codex page or a tutorial on how to a bare bone implementation of ...
1
vote
1answer
141 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 ...
1
vote
2answers
397 views

Rotating image does not work for custom image sizes

When rotating an image with the WordPress image editor it creates new images and renames all of the images for the thumbnail, medium and large image sizes that are default for WordPress. My problem ...
1
vote
1answer
924 views

Change “Thumbnail”, “Medium” and “Large” image sizes using functions.php?

Right now I'm using add_image_size to create the thumbnail sizes needed for my theme, completely bypassing the options in Settings > Media since I can't depend on users to enter the correct values ...
1
vote
1answer
134 views

Regenerate thumbnails after upload

I have this nice little code coming straight from the Wordpress codex if($_FILES['user_picture']['size'] != 0): if ( ! function_exists( 'wp_handle_upload' ) ) require_once( ABSPATH . ...