How to only show a featured image if it was set in post?

Normally genesis_get_image() is fetching the first image if you are not setting any featured image for your post. But sometime we are not wanting this default option. Using this simple code you can disable this:

add_filter( 'genesis_get_image_default_args', 'gd_show_only_assigned_featured_image' );
function gd_show_only_assigned_featured_image( $args ){
  $args['fallback'] = 'no-attachment'; // By Default it is 'first-attached'

  return $args;
}
This site uses cookies to offer you a better browsing experience. By browsing this website, you agree to our use of cookies.