Function to Change Add Thumbnails into ‘Manage Posts/Pages’ Table

/**
* code #13 - add post thumbnails into "manage posts/pages" admin table
* source - http://wordpress.stackexchange.com/a/6021/8922
*/
if(!function_exists('add_thumb_column') && function_exists('add_theme_support')) {
add_theme_support('post-thumbnails', array('post', 'page'));

function add_thumb_column($cols) {
$cols['thumbnail'] = __('Thumbnail');
return $cols;
}

function add_thumb_value($column_name, $post_id) {
$width = 35;
$height = 35;

if('thumbnail' == $column_name ) {
$thumbnail_id = get_post_meta($post_id, '_thumbnail_id', true);

$attachments = get_children(array('post_parent' => $post_id, 'post_type' => 'attachment', 'post_mime_type' => 'image'));

if($thumbnail_id)
$thumb = wp_get_attachment_image($thumbnail_id, array($width, $height), true);
elseif($attachments) {
foreach($attachments as $attachment_id => $attachment) {
$thumb = wp_get_attachment_image($attachment_id, array($width, $height), true);
}
}
if(isset($thumb) && $thumb) {
echo $thumb;
} else {
echo __('None');
}
}
}

add_filter('manage_posts_columns', 'add_thumb_column');
add_action('manage_posts_custom_column', 'add_thumb_value', 10, 2);

add_filter('manage_pages_columns', 'add_thumb_column');
add_action('manage_pages_custom_column', 'add_thumb_value', 10, 2);

If your website is prominently using the featured images in posts then you may consider adding this large function to your file. The two filter/action sets will add another column into the ‘manage posts’ and ‘manage pages’ table within the admin panel. This column will display a smaller thumbnail shot of the featured image for each piece of content.

Be aware that loading your pages will probably take just a couple extra seconds. Pulling images into the page is always a bit more tedious, and tack on the database query results as well. But it’s a really nice piece of functionality worth testing out, if you have the time.