From 1a8967c36ffea9e9c21e350e7e47a0b5a38f944f Mon Sep 17 00:00:00 2001 From: Antonin Lenfant Date: Sun, 12 Mar 2017 22:28:31 +0900 Subject: [PATCH] Use large wordpress-generated thumbnail for featured posts The size thumbnail-size doesn't seem to exist by default, so I replaced it by large which is one of those available according to the docs: https://codex.wordpress.org/Post_Thumbnails#Thumbnail_Sizes It fixed huge network usage on my website. --- inc/template-tags.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/template-tags.php b/inc/template-tags.php index 77cea64..add4a23 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -72,7 +72,7 @@ function karta_background_image_url( $post_id = null ) { if ( has_post_thumbnail() ) { $thumb_id = get_post_thumbnail_id(); - $thumb_url_array = wp_get_attachment_image_src( $thumb_id, 'thumbnail-size', true ); + $thumb_url_array = wp_get_attachment_image_src( $thumb_id, 'large', true ); $thumb_url = $thumb_url_array[0]; echo esc_attr( "style=background-image:url(".esc_url($thumb_url).")" ); }