// 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>