I'm developing a custom theme that uses several custom image sizes defined in my functions.php like this:
add_theme_support('post-thumbnails');
add_image_size('featured_thumb', 175, 120, true);
I then get posts from the database and output on a page like this:
$featured=get_posts();
if ($featured)
{
global $post;
foreach($featured as $post)
{
setup_postdata($post);
the_post_thumbnail('featured_thumb');
}
wp_reset_postdata();
}
But this code always outputs a full sized image. I can't figure out why - everything else seems to work alright (the_title(), the_permalink() etc) and it does get the correct image but not in the size I requested.
Does anyone know under what circumstances the_post_thumbnail()
will ignore my image size, or what I'm doing wrong?
Edit: using WP 3.4.1
post_thumbnail_size
to change the size. Has any plugin or your theme hooked into it?