From cecfff1b89075d8662efbfbefb48f7212806a0d0 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Wed, 22 Aug 2018 12:39:04 -0400 Subject: [PATCH] Add version numbers to featured images to avoid caching --- functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 2147613..c0ec642 100644 --- a/functions.php +++ b/functions.php @@ -78,9 +78,9 @@ function glm_get_header($memberID = false) { if ((has_post_thumbnail() && $post->post_type == 'page')) { $image_data = wp_get_attachment_image_src(get_post_thumbnail_id(), "full"); $image_data = $image_data[0]; - echo ' style="background-image: url('.$image_data.');height:0;padding:0;padding-bottom:32%;background-position:center center;background-size: cover;background-repeat:no-repeat;max-height: 600px; "'; + echo ' style="background-image: url('.$image_data.'?v=1.0);height:0;padding:0;padding-bottom:32%;background-position:center center;background-size: cover;background-repeat:no-repeat;max-height: 600px; "'; } else if (!is_page('member-detail')) { - echo ' style="background-image: url('.get_template_directory_uri().'/assets/default.jpg);height:0;padding:0;padding-bottom:32%;background-position:center center;background-size: cover;background-repeat:no-repeat;max-height: 600px; "'; + echo ' style="background-image: url('.get_template_directory_uri().'/assets/default.jpg?v=1.0);height:0;padding:0;padding-bottom:32%;background-position:center center;background-size: cover;background-repeat:no-repeat;max-height: 600px; "'; } else { echo ' class="no-featured"'; } -- 2.17.1