title: Wordpress Function to change existing featured image size
body: <p>I am using the custom-community (CC) theme
  I have created a sub-theme
  I have created a functions.php file</p>
  
  <p>The original CC theme has this code in the functions.php</p>
  
  <pre><code>        // This theme uses post thumbnails
      if (function_exists('add_theme_support')) {
          add_theme_support('post-thumbnails');
          set_post_thumbnail_size(222, 160, true);
          add_image_size('slider-top-large', 1006, 250, true);
          add_image_size('slider-large', 990, 250, true);
          add_image_size('slider-responsile', 925, 250, true);
          add_image_size('slider-middle', 756, 250, true);
          add_image_size('slider-thumbnail', 80, 50, true);
          add_image_size('post-thumbnails', 222, 160, true);
          add_image_size('single-post-thumbnail', 598, 372, true);
      }
  </code></pre>
  
  <p>I want to change the post thumbnail size from 222x160 to a larger size, e.g. 400x300.</p>
  
  <p>I have read the codex on Post Thumbnails, Function Reference/add image size, Function Reference/set post thumbnail size, Function Reference/the post thumbnail, Plugin API/Filter Reference.</p>
  
  <p>Unfortunately my understanding of PHP is still very limited and I am in the early-learning phase.</p>
  
  <p>I have seen examples of what sound like similar problems elsewhere for the twenty-ten theme, but nothing I can understand or apply myself without my functions.php locking me out, deleting it on ftp and starting again.</p>
  
  <p>I am still unsure if it is possible to add a function to my sub-theme functions.php that will either unset/re-assign an image size for the thumbnail (or any other specified image type) in the parent theme.</p>
  
  <p>To clarify that my functions.php and sub-theme are working correctly I can confirm that I have successfully used functions for styling my login, I just lack the understanding to achieve this myself.</p>
  
  <p>Following the tuts-plus tutorial (Point 6 - Remove Additional Image Sizes) I tried the following code in my functions.php:</p>
  
  <pre><code>//change thumbnail size
  function remove_parent_image_sizes( $sizes ) {
      unset( $sizes['post-thumbnail-size'] );
      return $sizes;
  }
  
  if ( function_exists( 'add_image_size' ) ) {
      // 400 pixels wide and 300 px tall, cropped
      add_image_size( 'post-thumbnails', 400, 300, true );
  }
  </code></pre>
  
  <p>I then removed a featured image from a post and applied a new one but it still has the dimensions 222x160.</p>
  
  <p>Still stumped :(</p>
  
  <p>Also tried it this way but still no luck;</p>
  
  <pre><code>//change thumbnail size
  function remove_parent_image_sizes( $sizes ) {
      unset( $sizes['post-thumbnail-size'] );
      return $sizes;
  }
  
  if (function_exists('add_theme_support')) {
      add_theme_support('post-thumbnails');
      set_post_thumbnail_size(400, 300, true);
      add_image_size('post-thumbnails', 400, 300, true);
  }
  </code></pre>
  
  <p>And adding this line (modified from the stackexchange link) to the end caused my site to break:</p>
  
  <pre><code>add_action( 'after_setup_theme', 'remove_parent_image_sizes' );
  </code></pre>