mirror of
https://github.com/10h30/trestle.git
synced 2026-07-11 18:56:07 +09:00
Added filter to remove Genesis default image fallback of first-attached.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user