Add version numbers to featured images to avoid caching
authorLaury GvR <laury@gaslightmedia.com>
Wed, 22 Aug 2018 16:39:04 +0000 (12:39 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Wed, 22 Aug 2018 16:39:04 +0000 (12:39 -0400)
functions.php

index 2147613..c0ec642 100644 (file)
@@ -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"';
     }