From 5739e9e523e7c06156e3412ed29530060853140d Mon Sep 17 00:00:00 2001 From: Kelly Dwan Date: Wed, 13 Sep 2023 17:33:13 -0400 Subject: [PATCH] Screenshots: Add aspect ratio to the desktop image screenshot This will keep mshots pending & 404 images consistent with the real screenshot sizes. Fixes #148 --- .../themes/wporg-showcase-2022/src/site-screenshot/index.php | 2 +- .../themes/wporg-showcase-2022/src/site-screenshot/style.scss | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/source/wp-content/themes/wporg-showcase-2022/src/site-screenshot/index.php b/source/wp-content/themes/wporg-showcase-2022/src/site-screenshot/index.php index 15901a52..78c7ad52 100644 --- a/source/wp-content/themes/wporg-showcase-2022/src/site-screenshot/index.php +++ b/source/wp-content/themes/wporg-showcase-2022/src/site-screenshot/index.php @@ -85,7 +85,7 @@ function render( $attributes, $content, $block ) { function get_site_screenshot_src( $post, $type = 'desktop' ) { $screenshot_url = false; $media_id = get_post_meta( $post->ID, 'screenshot-' . $type, true ); - $cache_key = '20221208'; // To break out of cached image. + $cache_key = '20230913'; // To break out of cached image. $size = 'screenshot-' . $type; $all_sizes = wp_get_registered_image_subsizes(); diff --git a/source/wp-content/themes/wporg-showcase-2022/src/site-screenshot/style.scss b/source/wp-content/themes/wporg-showcase-2022/src/site-screenshot/style.scss index d07f7e50..84d0f4a6 100644 --- a/source/wp-content/themes/wporg-showcase-2022/src/site-screenshot/style.scss +++ b/source/wp-content/themes/wporg-showcase-2022/src/site-screenshot/style.scss @@ -53,4 +53,8 @@ width: 100%; vertical-align: middle; } + + &.is-size-desktop img { + aspect-ratio: 535 / 300; + } }