Genesis: Default Post Thumbnail

// Default post thumbnail
add_filter('genesis_get_image', 'default_image_fallback', 10, 2);
	function default_image_fallback($output, $args) {
			global $post;
			if( $output || $args['size'] == 'full' )
					return $output;
			
			$thumbnail = CHILD_URL.'/images/thumb.jpg';
			
			switch($args['format']) {
			
					case 'html' :
							return '<img src="'.$thumbnail.'" class="alignleft post-image" alt="'. get_the_title($post->ID) .'" />';
							break;
					case 'url' :
							return $thumbnail;
							break;
				 default :
						 return $output;
							break;
			}
	}

4 thoughts on “Genesis: Default Post Thumbnail”

Leave a Comment