Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.
  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
add comment

1 Answer

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:

the_post_thumbnail('news-thumbnail');
share|improve this answer
add comment

Your Answer

 
discard

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.