Title: New Image Size
Last modified: August 22, 2016

---

# New Image Size

 *  Resolved [kimpeartgratton](https://wordpress.org/support/users/kimpeartgratton/)
 * (@kimpeartgratton)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/new-image-size/)
 * My brain is going to explode.
 * When writing a new post, I want to be able to add to the media gallery ‘attachment
   display settings’ size options.
 * I seem to have a default listing of Thumb, Med, Lge and Full. I want to create
   another size.
 * I have tried myself and to no avail.
 * If anyone can help, can you please tell me both what I need to write and what
   file I need to put it in. I have tried doing it myself and perhaps I’m not putting
   the script in the correct location.
 * Many thanks
 * Kim

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [Advanced SEO](https://wordpress.org/support/users/jole5/)
 * (@jole5)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/new-image-size/#post-5232895)
 * You need to register new custom image size.
    to do that, open your functions.
   php file (inside theme folder).
 * Start by adding the support of post thumbnails (probably it is already supported,
   you maybe can skip this)
 * `add_theme_support( 'post-thumbnails' );`
 * Now you can use the functionality of registering additional image sizes you need
   like this:
 *     ```
       add_image_size( 'your-image-size-name', 120, 120, true ); // Hard crop
       add_image_size( 'your-image-size-name', 600, 400 ); // Soft crop
       ```
   
 * You need to chose some name for that size (thumbnail, medium, large and full 
   are already taken, write anything else), and to set size (width, height), if 
   you add “true” WP will resize exactly to that dimensions, not proportional.
 * To display that image size on your pages put this code in theme where you wish
   to display it:
 * `<?php the_post_thumbnail( 'your-image-size-name' ); ?>`
 * More info on:
 * [http://codex.wordpress.org/Function_Reference/add_image_size](http://codex.wordpress.org/Function_Reference/add_image_size)
 *  Thread Starter [kimpeartgratton](https://wordpress.org/support/users/kimpeartgratton/)
 * (@kimpeartgratton)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/new-image-size/#post-5232912)
 * Thank you for replying.
 * I had read the wordpress section you linked to.
 * I had already carried out the first two parts of the instructions, but I am lost
   of the last bit.
 * When you say, “…put this code in the theme…” What do you mean? I want to be able
   to use the new sizes in blog posts, in the main content.
 * Thanks again.
 * Kim
 *  [Rajan Vijayan](https://wordpress.org/support/users/rajanit2000/)
 * (@rajanit2000)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/new-image-size/#post-5232914)
 * Hi Kim.,
 * One you add the code in your theme. Add this plugin and regenerate new post thumbnails
 * [https://wordpress.org/plugins/regenerate-thumbnails](https://wordpress.org/plugins/regenerate-thumbnails)
 * Rajan V
 *  Thread Starter [kimpeartgratton](https://wordpress.org/support/users/kimpeartgratton/)
 * (@kimpeartgratton)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/new-image-size/#post-5232915)
 * This looks like what I want to do, but where oh where does it go?
 * For Media Library Images (Admin)
    You can also make your custom sizes selectable
   from your WordPress admin. To do so, you have to use the image_size_names_choose
   hook to assign them a normal, human-readable name…
 * add_filter( ‘image_size_names_choose’, ‘my_custom_sizes’ );
 * function my_custom_sizes( $sizes ) {
    return array_merge( $sizes, array( ‘your-
   custom-size’ => __( ‘Your Custom Size Name’ ), ) ); }
 *  Thread Starter [kimpeartgratton](https://wordpress.org/support/users/kimpeartgratton/)
 * (@kimpeartgratton)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/new-image-size/#post-5232916)
 * Ha ha – worked it out.
 * So, for anyone else like me who wants to create new image sizes accessible from
   the Media Library:
 * 1. open your functions.php file (inside theme folder).
 * 2. Add theme support by pasting in:
 *     ```
       add_theme_support( 'post-thumbnails' );
       ```
   
 * 3. Add image sizes by pasting in:
 *     ```
       add_image_size( 'your-image-size-name', 120, 120, true ); // Hard crop
       add_image_size( 'your-image-size-name', 600, 400 ); // Soft crop
       ```
   
 * 4. Add to Media Library by pasting in:
 *     ```
       add_filter( 'image_size_names_choose', 'my_custom_sizes' );
   
       function my_custom_sizes( $sizes ) {
           return array_merge( $sizes, array(
               'your-custom-size' => __('Your Custom Size Name'),
           ) );
       }
       ```
   
 * Further reading:
    [http://codex.wordpress.org/Function_Reference/add_image_size](http://codex.wordpress.org/Function_Reference/add_image_size)
   [](http://codex.wordpress.org/Function_Reference/add_image_size)
 * [http://codex.wordpress.org/Plugin_API/Filter_Reference/image_size_names_choose](http://codex.wordpress.org/Plugin_API/Filter_Reference/image_size_names_choose)
   [](http://codex.wordpress.org/Plugin_API/Filter_Reference/image_size_names_choose)
 *  [Rajan Vijayan](https://wordpress.org/support/users/rajanit2000/)
 * (@rajanit2000)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/new-image-size/#post-5232917)
 * Hi again.,
 * Just put your theme function file (functions.php)
 *     ```
       add_theme_support( 'post-thumbnails' );
       add_image_size( 'your-image-size-name', 120, 120, true ); // Hard crop
       add_image_size( 'your-image-size-name', 600, 400 ); // Soft crop
       ```
   
 * And Put this code where you want to display
 * `<?php the_post_thumbnail( 'your-image-size-name' ); ?>`

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘New Image Size’ is closed to new replies.

## Tags

 * [image](https://wordpress.org/support/topic-tag/image/)
 * [image size](https://wordpress.org/support/topic-tag/image-size/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 3 participants
 * Last reply from: [Rajan Vijayan](https://wordpress.org/support/users/rajanit2000/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/new-image-size/#post-5232917)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
