• Skip to primary navigation
  • Skip to main content

Genesis Community

Resources for Genesis WordPress Theme Users

  • Facebook
  • Twitter
  • Slack
  • Wiki
  • Login
You are here: Home / Wikis / Genesis / Stop archives from using first attached image as fallback when no featured image is set

Stop archives from using first attached image as fallback when no featured image is set

add_filter( 'genesis_get_image_default_args', 'prefix_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 prefix_stop_auto_featured_image( $args ) {
    if ( ! isset( $args['context'] ) || 'archive' !== $args['context'] )
        return $args;
    $args['fallback'] = false;
    return $args;
}
Source: https://gist.github.com/GaryJones/7070243

Posted by: Sridhar Katakam Category: Genesis Tags: Gary Jones

« Add links to previous and next posts on single posts
Entry Hooks (Loop Actions) »

Copyright © 2025 · Genesis Sample on Genesis Framework · WordPress · Log in