Uffo
Uffo

Reputation: 10046

Wordpress post thumbnail size

I have this line: <?php the_post_thumbnail( array(140,180) ); ?> But it still doesn't display the right sizes, is there a way to achive the exact sizes that I want?

Upvotes: 0

Views: 284

Answers (1)

Paul Bain
Paul Bain

Reputation: 4397

Try adding a custom image size first and using a reference to that definition: http://codex.wordpress.org/Function_Reference/add_image_size

In functions.php

if ( function_exists( 'add_theme_support' ) ) {
    add_theme_support( 'post-thumbnails' );
    set_post_thumbnail_size( 150, 150 ); // default Post Thumbnail dimensions   
}

Then you can use <?php the_post_thumbnail( 'post-thumbnails' ); ?>

Upvotes: 2

Related Questions