diff --git a/src/wp-content/themes/twentyseventeen/components/header/header-image.php b/src/wp-content/themes/twentyseventeen/components/header/header-image.php index c4437d2be8..102456ddcc 100644 --- a/src/wp-content/themes/twentyseventeen/components/header/header-image.php +++ b/src/wp-content/themes/twentyseventeen/components/header/header-image.php @@ -19,15 +19,6 @@
- ID ); - $thumbnail_attributes = wp_get_attachment_image_src( $post_thumbnail_id, 'twentyseventeen-featured-image' ); - ?> - -
- -
diff --git a/src/wp-content/themes/twentyseventeen/components/page/content-front-page.php b/src/wp-content/themes/twentyseventeen/components/page/content-front-page.php index cb0ab7d649..38fa0f77e9 100644 --- a/src/wp-content/themes/twentyseventeen/components/page/content-front-page.php +++ b/src/wp-content/themes/twentyseventeen/components/page/content-front-page.php @@ -11,6 +11,23 @@ ?>
> + ID ), 'twentyseventeen-featured-image' ); + + $post_thumbnail_id = get_post_thumbnail_id( $post->ID ); + + $thumbnail_attributes = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'twentyseventeen-featured-image' ); + + // Calculate aspect ratio: h / w * 100%. + $ratio = $thumbnail_attributes[2] / $thumbnail_attributes[1] * 100; + ?> + +
+
+
+ + +
diff --git a/src/wp-content/themes/twentyseventeen/inc/template-functions.php b/src/wp-content/themes/twentyseventeen/inc/template-functions.php index 8e6da7992a..5ea106b70b 100644 --- a/src/wp-content/themes/twentyseventeen/inc/template-functions.php +++ b/src/wp-content/themes/twentyseventeen/inc/template-functions.php @@ -34,8 +34,8 @@ function twentyseventeen_body_classes( $classes ) { $classes[] = 'twentyseventeen-front-page'; } - // Add a class if there is a featured image or custom header. - if ( has_header_image() || ( has_post_thumbnail() && twentyseventeen_is_frontpage() ) ) { + // Add a class if there is a custom header. + if ( has_header_image() ) { $classes[] = 'has-header-image'; }