OK, firstly, if you want to completely exclude TimThumb, and your images are currently not the right size, you need to find a plugin that can batch resize the media library .
, (.. wp_posts) .
$uploads = wp_upload_dir();
$results = $wpdb->get_results("SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = '_wp_attached_file'");
$attachments = array();
foreach ($results as $row)
$attachments[ intval($row->post_id) ] = $row->meta_value;
$images = $wpdb->get_results("SELECT post_id, meta_value AS 'url' FROM $wpdb->postmeta WHERE meta_key = 'Featured Image'");
foreach ($images as $image) {
if (preg_match('#^https?://#', $image->url))
$image->url = str_replace($uploads['baseurl'], '', $image->url);
$filename = ltrim($image->url, '/');
if ($attachment_ID = array_search($filename, $attachments)) {
update_post_meta($image->post_id, '_thumbnail_id', $attachment_ID);
delete_post_meta($image->post_ID, 'Featured Image');
}
}
, , , - , .