set_post_thumbnail_size() problems
-
Hi, I’ve been googling and searching the forums for the answer why this doesn’t work but all of the solutions I’ve found hasn’t worked.
What I’m trying to do is to set a thumbnailsize of 225×225 pixels with hard crop and what I’ve tried is the following:
In my themes function.php I’ve added:
add_image_size( 'my-thumb-size', 225, 225, true); if ( function_exists( 'add_theme_support' ) ) { add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 225, 225, true ); }
In my template I’ve tried calling the_post_thumbnail() like this:
the_post_thumbnail('my-thumb-size'); the_post_thumbnail() the_post_thumbnail('post-thumbnails') the_post_thumbnail( array(225,225) )
but neither works. When using just the the_post_thumbnail() tag i get images of size 125×125 which is the default thumbnail size in the media upload section, but this however differs from the one set in media settings. I’ve also been changing the default sizing in the media settings but this didn’t work either and finally I went for the approach found here in desperation but no luck with that either.
Anyone know what I’m doing wrong? I’m developing my own theme so changing isn’t really an option.
Thanks
/Olof
- The topic ‘set_post_thumbnail_size() problems’ is closed to new replies.