diff --git a/controller/classes/Subtemplate.php b/controller/classes/Subtemplate.php index 6750db7..bd9027d 100644 --- a/controller/classes/Subtemplate.php +++ b/controller/classes/Subtemplate.php @@ -104,6 +104,9 @@ class Subtemplate { case 'events': $result .= $this->eventPage($subtemplateTitle); break; + case 'testimonials': + $result .= $this->testimonials($subtemplateTitle); + break; } } } @@ -1174,4 +1177,52 @@ class Subtemplate { return $result; } + + // + // Subtemplate: Testimonials + // + public function testimonials($subtemplateTitle) { + + $args = array( + 'post_type' => 'testimonial', + 'order' => 'ASC' + ); + + $testimonials = get_posts($args); + $testimonialMarkup = ''; + + if (!empty($testimonials)) { + foreach ($testimonials as $testimonial) { + + $id = $testimonial->ID; + $quote = get_field('quote', $id); + $name = get_field('name', $id); + $company = get_field('company', $id); + $link = get_field('link', $id); + $photo = get_field('photo', $id); + + $testimonialMarkup .= "