Genesis default Thumbnail

This is how u make a default featured image / thumbnail show up when your posts have no images attached.

// 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;
      }
  }

Speak Your Mind

*