<!-- Begin Thumbnail -->
<p>
<?php if(function_exists('the_post_thumbnail') && has_post_thumbnail()) : the_post_thumbnail('gantryThumb', array('class' => 'rt-image '.$gantry->get('thumb-position'))); endif; ?>
</p>
<!-- End Thumbnail -->
<?php the_post_thumbnail('full'); ?>
function catch_that_image() {
global $post, $posts;
$first_img = '';
ob_start();
ob_end_clean();
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
$first_img = $matches [1] [0];
if(empty($first_img)){ //Defines a default image
$first_img = "/images/default.png";
}
return $first_img;
}
<div id="thumb"><a href="<?php the_permalink(); ?>"><img src="<?php echo catch_that_image() ?>"></a></div>
#thumb img{
width:100px;
height:100px;
float:left;
margin-right: 5px;
...}
Time to create page: 0.069 seconds