]> _ Git - ccv-wordpress.git/commitdiff
WIP #3267 @1
authorStephen Cameron <stephen@cubedesigners.com>
Tue, 21 Jan 2020 17:47:13 +0000 (18:47 +0100)
committerStephen Cameron <stephen@cubedesigners.com>
Tue, 21 Jan 2020 17:47:13 +0000 (18:47 +0100)
wp-content/themes/CCV/resources/views/partials/content-scientific_news.blade.php

index 8731dee2813dcec60fd740e2c2a15bbc22406bf4..bb365a482a9f3a7dae44ac47deae3ef8f6225f93 100644 (file)
@@ -3,11 +3,13 @@
   // exists outside the loop, we are sometimes getting data that is passed in and other times relying on
   // the global loop context. As a result, the code had to be modified a bit to work in both situations.
   $postID = isset($science_post) ? $science_post['ID'] : $post->ID;
+  $images = tr_posts_field('images', $postID);
+  $image = is_array($images) && isset($images[0]) ? wp_get_attachment_image_url($images[0], 'small') : '';
 @endphp
 
 <article <?php post_class('flex items-start mt-1v sm:block sm:mt-12', $postID) ?>>
 
-  <div class="post-featured-image min-w-0 mr-1v mb-1v" style="background-image: url({{ get_the_post_thumbnail_url($postID) }}); max-width: 135px;">
+  <div class="post-featured-image min-w-0 mr-1v mb-1v" style="background-image: url({{ $image }}); max-width: 135px;">
     <a href="{{ get_permalink($postID) }}">
       <div class="post-featured-image-sizer">{{-- Just here as a proportional sizer thanks to the padding --}}</div>
     </a>