From cfe50bfbc93d1ba90304e083e4bd0aa3664233f0 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Mon, 7 Mar 2016 22:03:26 +0100 Subject: [PATCH] grab testimonials from ACF post object list --- controller/classes/Subtemplate.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/controller/classes/Subtemplate.php b/controller/classes/Subtemplate.php index 1db794c..c6a733c 100644 --- a/controller/classes/Subtemplate.php +++ b/controller/classes/Subtemplate.php @@ -1183,17 +1183,10 @@ class Subtemplate { // public function testimonials($subtemplateTitle) { - $args = array( - 'post_type' => 'testimonial', - 'order' => 'ASC', - 'orderby' => 'rand', - 'posts_per_page' => 3 - ); - - $testimonials = get_posts($args); + $testimonials = get_sub_field('testimonials'); $testimonialMarkup = ''; - if (!empty($testimonials)) { + if ( $testimonials ) { foreach ($testimonials as $testimonial) { $id = $testimonial->ID;