The following line is incorrect as showposts
is deprecated.
$recent = new WP_Query("showposts=30");
Instead use,
$recent = new WP_Query('posts_per_page=30');
Following that,
Does the thumbnail size of 80×80 exist?
array(80,80)
If not try any of,
$thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), small );
$thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), medium );
$thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), large );
Remember each of small, medium or large – refers to different filenames or src
– so if you want to retrieve the full resolution image, original upload then use large
.
If you must return the src
URL as
http://domain.com/image_80x_80x.jpg //example
…meaning that you definitely want the 80×80 version and it does not exist then you will need to regenerate your thumbnails.
You can use: http://wordpress.org/extend/plugins/regenerate-thumbnails/
If you did not add the image size of 80×80 to your theme you can do so using the add_image_size
function in your functions.php file,
add_image_size( 'my_custom_size', 80, 80 );
Now, when uploading new images, you will also get a 80×80 version. You can then refer to it as mentioned above by either,
wp_get_attachment_image_src( $id, array(80,80) ); //via array specifying pixel w & h
or
wp_get_attachment_image_src( $id, my_custom_size ); //via name used in add_image_size