WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
  1. In Loop = There exist a way or hook to get the featured image, if not, the the first image from post and cropit before display it on frontend?

  2. Re-asking my question: On upload. How do I set a featured crop size for a giving custom post type like: news.

Thanks in advance.

share|improve this question
Re-asking my question: How do I set a featured crop size for a giving custom post type like: news. – José Pablo Orozco Marín Feb 9 '11 at 1:49
are you using featured images on any other post type or just the one? – curtismchale Feb 9 '11 at 2:55
up vote 2 down vote accepted

In your theme's functions.php add a call add_image_size($name, $width, $height, $crop) where $name is the name or identifier for the new size, and $crop is whether the image should cropped to fit the dimensions or just shrunk to fit within the dimensions given. This will register the new size that will be automatically created when you upload new images:

add_image_size('news-thumbnail', 500, 200, true);

Then in the template file for your news post type, call the specific thumbnail size name:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.