Title: Adding new thumbnail size
Last modified: August 21, 2016

---

# Adding new thumbnail size

 *  Resolved [nzguyyy](https://wordpress.org/support/users/nzguyyy/)
 * (@nzguyyy)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/adding-new-thumbnail-size/)
 * I am trying to create a new thumbnail size to use on a [specific category page](http://www.planitnz.com/category/new-zealand-tours/)
   as I want it to take up the full 400pixels width.
 * In my function.php file I have added this:
 * `if ( function_exists( ‘add_theme_support’ ) ) {
 *  add_theme_support( ‘post-thumbnails’ );
    add_image_size( ‘category-thumb’, 300,
   9999 );
 * }’
 * and then on my category-new-zealand-tours.php file I added this:
 * <?php
    if ( has_post_thumbnail() ) { the_post_thumbnail( ‘category-thumb’ ); }?
   >
 * but it doesn’t seem to work. Any ideas what I’m doing wrong? Thanks in advance!

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

 *  Thread Starter [nzguyyy](https://wordpress.org/support/users/nzguyyy/)
 * (@nzguyyy)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/adding-new-thumbnail-size/#post-4512363)
 * Fixed
 *  [Bassliner](https://wordpress.org/support/users/bassliner/)
 * (@bassliner)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/adding-new-thumbnail-size/#post-4512420)
 * Please share your solution. Thx 🙂
 *  Thread Starter [nzguyyy](https://wordpress.org/support/users/nzguyyy/)
 * (@nzguyyy)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/adding-new-thumbnail-size/#post-4512530)
 * Hi Bassilner
 * In the functions.php file this needs to be added:
 *     ```
       f ( function_exists( 'add_theme_support' ) ) {
   
       add_theme_support( 'post-thumbnails' );
       add_image_size( 'whatever-you-want-to-name-it', 300, 9999 );
   
       }
       ```
   
 * This creates a new thumbnail size each time you add a featured image. In this
   particular instance, it is 300 pixels wide with no limit on its height.
 * Then, on my category page I added the following:
 *     ```
       <?php if(has_post_thumbnail()) : ?>
   
       				<div class="image-wrap">
   
       				<a href="<?php the_permalink();?>" title="<?php the_title();?>">
   
       					<?php the_post_thumbnail( 'whatever-you-want-to-name-it' ); ?>
   
       				</a>
   
       				</div>
   
       			<?php endif; ?>
       ```
   
 *  [Bassliner](https://wordpress.org/support/users/bassliner/)
 * (@bassliner)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/adding-new-thumbnail-size/#post-4512550)
 * Hi nzguyyy,
 * thanks a lot. I will try that.

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

The topic ‘Adding new thumbnail size’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [Bassliner](https://wordpress.org/support/users/bassliner/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/adding-new-thumbnail-size/#post-4512550)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
