• Skip to secondary menu
  • Skip to main content
  • Skip to primary sidebar
  • Home
  • Projects
  • Products
  • Themes
  • Tools
  • Request for Quote

Vengala Vinay

Having 9+ Years of Experience in Software Development

  • Home
  • WordPress
  • PHP
  • Codeigniter
  • Magento
  • Selenium
  • Server
Home » How to Stop Genesis from using first attached post image if no featured image

How to Stop Genesis from using first attached post image if no featured image

Archive pages are showing image even if no featured image is displayed. I only want the image shown if a featured image is assigned. If no featured image, then no image display on archive / category page.

Use the following snippet of code :

add_filter( 'genesis_get_image_default_args', 'vengala_stop_auto_featured_image' );
/**
 * Stop Genesis archives from using first attached image as fallback when no featured image is set.
 *
 * @param  array $args Default image arguments.
 *
 * @return array       Amended default image arguments.
 */
function vengala_stop_auto_featured_image( $args ) {
    $args['fallback'] = false;
    return $args;
}

 

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

A little about the Author

Having 9+ Years of Experience in Software Development.
Expertised in Php Development, WordPress Custom Theme Development (From scratch using underscores or Genesis Framework or using any blank theme or Premium Theme), Custom Plugin Development. Hands on Experience on 3rd Party Php Extension like Chilkat, nSoftware.

Recent Posts

  • How to add share via email functionality after each item’s content using filters
  • How to modify the site generator meta tag using filters
  • How to use WordPress path utility functions to load external files and images
  • How to use hooks and add output content to page head
  • How to create a basic plugin in WordPress?

Copyright © 2025 · Vinay Vengala