Title: add_image_size function not working
Last modified: August 21, 2016

---

# add_image_size function not working

 *  [chrsc](https://wordpress.org/support/users/chrsc/)
 * (@chrsc)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/add_image_size-function-not-working/)
 * There seems to be a issue with the add_image_size function with WP 3.8.1. I’m
   using the roots theme as a base, and have edited my init.php file to add another
   image size to my available images.
 *     ```
       // Add post thumbnails (http://codex.wordpress.org/Post_Thumbnails)
         add_theme_support('post-thumbnails');
         // set_post_thumbnail_size(150, 150, false);
         // added with WP version 3.5.x
         add_image_size('isotope-portfolio', 760, 290, true);
         // added with WP version 3.5.x
         add_image_size('isotope-people-headshot', 180, 290, true);
         // added with WP version 3.8.1
         add_image_size('portfolio-530', 0, 530, true);
       ```
   
 * Each image size that was added in previous WP versoins prior to upgrading to 
   3.8.1 is available to use but the new size is not. I have tried using Regenerate
   Thumbnails version 2.2.4 and I have tried uploaded new images but the new image
   size is not getting created.
 * I apologize in advance if this is a simple issue that I’m overlooking.
 * Cheeers,
    Chris
 * [https://wordpress.org/plugins/regenerate-thumbnails/](https://wordpress.org/plugins/regenerate-thumbnails/)

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

 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [12 years, 4 months ago](https://wordpress.org/support/topic/add_image_size-function-not-working/#post-4582014)
 * Can you try uploading a new image manually to the Media Library, then attaching
   that newly uploaded image to a post to view it?
 *  Thread Starter [chrsc](https://wordpress.org/support/users/chrsc/)
 * (@chrsc)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/add_image_size-function-not-working/#post-4582016)
 * I tried that unsuccessfully, it was the second thing I did for troubleshooting,
   all the image sizes in 2014/02/ folder are there except for the _name_-835-530.
   jpg file which should be there with my new image size.
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [12 years, 4 months ago](https://wordpress.org/support/topic/add_image_size-function-not-working/#post-4582018)
 * > and have edited my init.php file
 * That does sound strange, I’m not familiar with your theme but aren’t you supposed
   to add this stuff to your Child Theme functions.php file (not init.php)?
 *  Thread Starter [chrsc](https://wordpress.org/support/users/chrsc/)
 * (@chrsc)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/add_image_size-function-not-working/#post-4582020)
 * Oh, the Roots theme loads all their files from the functions.php file like this:
 *     ```
       <?php
       /**
        * Roots includes
        */
       require_once locate_template('/lib/utils.php');           // Utility functions
       <strong>require_once locate_template('/lib/init.php');            // Initial theme setup and constants</strong>
       require_once locate_template('/lib/sidebar.php');         // Sidebar class
       require_once locate_template('/lib/config.php');          // Configuration
       require_once locate_template('/lib/activation.php');      // Theme activation
       require_once locate_template('/lib/cleanup.php');         // Cleanup
       require_once locate_template('/lib/nav.php');             // Custom nav modifications
       require_once locate_template('/lib/comments.php');        // Custom comments modifications
       require_once locate_template('/lib/rewrites.php');        // URL rewriting for assets
       require_once locate_template('/lib/widgets.php');         // Sidebars and widgets
       require_once locate_template('/lib/scripts.php');         // Scripts and stylesheets
       require_once locate_template('/lib/custom.php');          // Custom functions
       ```
   
 * The init.php file is where all the theme setup is.
 *  [Rick Alday](https://wordpress.org/support/users/mrdaro/)
 * (@mrdaro)
 * [12 years ago](https://wordpress.org/support/topic/add_image_size-function-not-working/#post-4582355)
 * I’m having a similar problem and it doesn’t seen to be theme or plugin related
   as it occurs on different themes and with all plugins (except for Regenerate 
   Thumbnails) but I can’t see to crop Medium and Large sizes. No matter what values
   I give ’em. I can regen custom sizes and Thumbnail size without any problem. 
   I’m suspecting it’s a WP 3.9 bug but I’m not sure.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [12 years ago](https://wordpress.org/support/topic/add_image_size-function-not-working/#post-4582356)
 * If you require assistance then, as per the [Forum Welcome](http://codex.wordpress.org/Forum_Welcome#Where_To_Post),
   please post your own topic instead of tagging onto someone else’s topic.
 * I am now closing this 3 month old topic as it references an older version of 
   WordPress.

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

The topic ‘add_image_size function not working’ is closed to new replies.

 * ![](https://ps.w.org/regenerate-thumbnails/assets/icon-128x128.png?rev=1753390)
 * [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/regenerate-thumbnails/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/regenerate-thumbnails/)
 * [Active Topics](https://wordpress.org/support/plugin/regenerate-thumbnails/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/regenerate-thumbnails/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/regenerate-thumbnails/reviews/)

## Tags

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

 * 6 replies
 * 4 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/add_image_size-function-not-working/#post-4582356)
 * Status: not resolved