diff --git a/functions.php b/functions.php index 6a08c31..b141a47 100644 --- a/functions.php +++ b/functions.php @@ -84,6 +84,9 @@ function trestle_theme_setup() { // Manually control where Post Info & Meta display add_action( 'the_post', 'trestle_post_info_meta', 0 ); + // Remove default featured image fallback of 'first-attached' + add_filter( 'genesis_get_image_default_args', 'trestle_featured_image_fallback' ); + /*=========================================== * General Actions & Filters diff --git a/lib/functions/theme-functions.php b/lib/functions/theme-functions.php index 21dbc96..bdff276 100644 --- a/lib/functions/theme-functions.php +++ b/lib/functions/theme-functions.php @@ -261,6 +261,23 @@ function trestle_post_info_meta() { } } +/** + * Unset Genesis default featured image fallback of 'first-attached' + * + * This function prevents Genesis' default behavior of displaying + * the 'first-attached' image as a post's featured image (in archive) + * views, even when the post has no current featured image. + * + * @since 1.0.0 + * + * @param array $args Default Genesis image args + * @return array Updated image args + */ +function trestle_featured_image_fallback( $args ) { + $args['fallback'] = false; + return $args; +} + /*=========================================== * General Actions & Filters