Reputation:
Can anybody can tell me how to give a particular image size to a image using the_post_thumbnail()
?
I have also tried add_image_size( 'image', 270, 180 );
and Wordpress admin settings, but I'm not able to change the image size as I want. Is there any dynamic way to change the image size?
Upvotes: 1
Views: 86
Reputation: 3371
you can use any of the above mentioned and can also use add_image_size function to define a new size with crop feature in yout theme function file, refer to http://codex.wordpress.org/Function_Reference/add_image_size. you might have problem with crop for images already uploaded, but after adding image size in theme functions.php file you need to upload images to crop them accordingly.
Upvotes: 0
Reputation: 2764
You can use
the_post_thumbnail('thumbnail');
the_post_thumbnail('medium');
the_post_thumbnail('large');
the_post_thumbnail('full');
the_post_thumbnail( array(100,100) );
Upvotes: 1