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;

Share This Article

Subscribe Membership Plan ($9.99/mo)

  • Get full access to all premium tutorials
  • Get Support for the posted content
  • Request for specific how-to tutorials
  • Cancel the subscription at anytime

Reader Interactions

Leave A Reply

Your email address will not be published. Required fields are marked *