0

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

1
  • Try removing the ) right after $post->ID.
    – its_me
    Commented Aug 17, 2012 at 5:45

1 Answer 1

1

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.

3
  • No dice :(, it's literally showing as <img width="250" height="250" src="http://DOMAIN/wp-content/uploads/2012/08/Sailormoon-150x150.jpg" /> :/
    – Jess
    Commented Aug 18, 2012 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. Commented Aug 18, 2012 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.
    – Jess
    Commented Aug 18, 2012 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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