Code: Select all
function show_thumb() {
global $post, $posts;
$thumb = '';
ob_start();
ob_end_clean();
$output = preg_match_all('/(\<embed.*\<\/embed\>)/is', $post->post_content, $matches);
$thumb = $matches [1] [0];
if(empty($thumb)) {
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
$thumb = $matches [1] [0];
if(empty($thumb)) {
} else {
return '<div class="thumb"><img src="'.$thumb.'" alt="thumb-'.$post->ID.'" /></div>';
}
} else {
return '<div class="thumb">'.$thumb.'</div>';
}
}