Here’s how to define a default post thumbnail that works with Genesis’s genesis_get_image()
function. Be sure to place a default image called thumb.jpg
in your child theme’s images folder.
/** Define a 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="attachment-'. $args['size'] .'" alt="'. get_the_title($post->ID) .'" />'; break; case 'url' : return $thumbnail; break; default : return $output; break; } }
Updated from Lori Berkowitz
See also: Nick the Geek’s tutorial – Genesis Explained Image Functions