1
0
mirror of https://github.com/ascribe/wp-theme synced 2024-12-22 09:13:38 +01:00

safeguard: make sure to always use thumbnail photo size

This commit is contained in:
Matthias Kretschmann 2016-03-08 10:37:37 +01:00
parent cfe50bfbc9
commit 2704ec576c

View File

@ -1189,18 +1189,20 @@ class Subtemplate {
if ( $testimonials ) { if ( $testimonials ) {
foreach ($testimonials as $testimonial) { foreach ($testimonials as $testimonial) {
$id = $testimonial->ID; $id = $testimonial->ID;
$quote = get_field('quote', $id); $quote = get_field('quote', $id);
$name = get_field('name', $id); $name = get_field('name', $id);
$company = get_field('company', $id); $company = get_field('company', $id);
$link = get_field('link', $id); $link = get_field('link', $id);
$photo = get_field('photo', $id); $photo_object = get_field('photo', $id);
$photo_size = 'thumbnail';
$photo_url = $photo_object['sizes'][$photo_size];
$testimonialMarkup .= "<div class='grid__col'> $testimonialMarkup .= "<div class='grid__col'>
<figure class='testimonial'> <figure class='testimonial'>
<blockquote class='testimonial__quote'>{$quote}</blockquote> <blockquote class='testimonial__quote'>{$quote}</blockquote>
<figcaption class='testimonial__caption'> <figcaption class='testimonial__caption'>
<img class='testimonial__avatar' src='{$photo}'> <img class='testimonial__avatar' src='{$photo_url}'>
<cite class='testimonial__cite'> <cite class='testimonial__cite'>
<span class='testimonial__name'>{$name}</span> <span class='testimonial__name'>{$name}</span>
<span class='testimonial__org'><a href='{$link}'>{$company}</a></span> <span class='testimonial__org'><a href='{$link}'>{$company}</a></span>