View Single Post
Old 02-29-2012, 12:47 PM  
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
UNTESTED:

Something like this might be easier to manage, add to your theme functions.php file:

Code:
function get_custom_thumb( $post_id ) {

	// get_post_meta returns a string
	if ( $my_thumb = get_post_meta($post_id, 'thumb', true) )
	{
		return '<img src="' . $my_thumb . '">';
	}

	// get_the_post_thumbnail returns the html img src
	if ( $my_thumb = get_the_post_thumbnail($post_id, 'thumbnail') )
	{
		return $my_thumb;
	}

	// return your own html placeholder image
	return '<img src="http://yoursite.com/image.jpg" />';
}
Then, in your template just use this where you want it displayed:
Code:
<?php echo get_custom_thumb( $post->ID ); ?>
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote