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.

Is it possible to set a different thumbnail size for different pages? For example, I want the thumbnails on my category, archive and tag view to be bigger than on my home.php.

Right now I have the following code in my function.php:

add_theme_support( 'post-thumbnails' );

set_post_thumbnail_size( 250, 165, true );

Do I have to modify my function.php or is it also possible to modify the thumbnail size in the home.php where I want the size to be different from index.php?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

In your functions file you need to add image sizes:

http://codex.wordpress.org/Function_Reference/add_image_size

share|improve this answer
    
Awesome, thanks so much!! :) –  japanworm Aug 26 '11 at 11:24
1  
accept it as the right answer then? –  Alex Older Aug 26 '11 at 12:56
    
Yes, thanks :) For now that was exactly what I was looking for :) –  japanworm Sep 1 '11 at 6:04
add comment

Here is the one you need: http://codex.wordpress.org/Function_Reference/wp_get_attachment_image

And some examples of how to use it:

That way, It will return an 300 width and 200 height image. But yeah, @Alex makes a right point here. Use add_image_size is easier.

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.