Custom Image Sizes lets you specify exactly the size in which to display an attachment.
add_image_size( 'my_custom_thumbnail_name', 220, 130, true ); in your theme’s functions.php file.echo wp_get_attachment_image($attachment_id, 'my_custom_thumbnail_name');add_image_size() was set.wp_get_attachment_image_src() or wp_get_attachment_image() with the desired thumbnail '[width]x[height]' dimensions, like so:echo wp_get_attachment_image($attachment_id, '220x80');
/**
* The above prints markup like
* <img width="220" height="80" title="" alt=""
* class="attachment-220x80" src="http://www.example.com/path-to-file/something-220x80.jpg" />
*/
Requires: 2.9 or higher
Compatible up to: 3.1.4
Last Updated: 2010-3-12
Downloads: 2,915
Got something to say? Need help?