One thing I did with some of my previous wordpress magazine themes is use a PHP output buffer to pull out the first img URL with code like this:
function match($regex, $str, $i = 0) {
if(preg_match($regex, $str, $match) == 1)
return $match[$i];
else
return false;
}
function get_the_image_url() {
ob_start();
the_content();
$imgBeg = strpos(ob_get_contents(), '<img');
$imgStuff = substr(ob_get_contents(), $imgBeg);
ob_end_clean();
$imgEnd = strpos($imgStuff, '>');
$postImg = substr($imgStuff, 0, $imgEnd+1);
$url = match('/src="(.*?)" /msi', $postImg, 1);
return $url;
}
And then I like to use a PHP thumbnail image generator/cache. Just call the image within the loop:
<a href="<?php the_permalink() ?>"><img class="thumb" src="<?php bloginfo('stylesheet_directory'); ?>/resize.php?src=<?php echo get_the_image_url(); ?>&h=160&w=160&zc=1" height="160" width="160" alt="<?php the_title(); ?>"></img></a>
That's the way I do it. PS: the get_the_image_url() funtion had many more options, I just stripped them out for simplicity. It could use some refactoring