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.

I've had some issues recently with this code below to display the featured image of a page:

add_theme_support( 'post-thumbnails' );
add_image_size("homepageFeatured", 250, 250, false);
wp_attachment_image(get_post_thumbnail_id($post->ID), 'homepageFeatured'); //in the loop

The issue is that it's pulling a 150x150 image (the 250x250 does exist, and the url is accessible, I used the Thumbnail Regenerator plugin) and then resizing that up to 250x250 (causing to to be blurry).

Any ideas on why this is occurring?

Thanks,
Max

share|improve this question
    
Try removing the ) right after $post->ID. –  its_me Aug 17 '12 at 5:45
add comment

1 Answer

up vote 1 down vote accepted

Are you just trying to display the post thumbnail in the homepageFeatured size? if so, try:

echo get_the_post_thumbnail($post->ID, 'homepageFeatured');

In your loop.

share|improve this answer
    
No dice :(, it's literally showing as <img width="250" height="250" src="http://DOMAIN/wp-content/uploads/2012/08/Sailormoon-150x150.jpg" /> :/ –  mazzzzz Aug 18 '12 at 0:01
    
So -- bit confused. You marked my answer correct, but it's not working? Or did you comment in the wrong place? Just want to make sure we don't confuse anyone that stumbles across this. –  FlashingCursor Aug 18 '12 at 17:22
    
Yeah, I discovered what was going wrong, and your answer was the help that caused that, so I gave you the points. It was a much more general issue of devs not talking to eachother (another guy flipped the featured rotator to a widget area, but left the template part, so I just assumed that was the one being used); but I used your code, and it was cleaner than mine. –  mazzzzz Aug 18 '12 at 21:52
    
Righton. :) Thanks. –  FlashingCursor Aug 20 '12 at 19:21
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.