'post', 'cat' => $thebusiness_home_testimonial_category, 'posts_per_page' => $thebusiness_home_testimonial_number, ); } } else { $thebusiness_home_testimonial_posts = salient_customizer_get_repeated_all_value(3 , $repeated_page); $thebusiness_home_testimonial_posts_ids = array(); if (null != $thebusiness_home_testimonial_posts) { foreach ($thebusiness_home_testimonial_posts as $thebusiness_home_testimonial_post) { if (0 != $thebusiness_home_testimonial_post['thebusiness-home-testimonial-pages-ids']) { $thebusiness_home_testimonial_posts_ids[] = $thebusiness_home_testimonial_post['thebusiness-home-testimonial-pages-ids']; } } if( !empty( $thebusiness_home_testimonial_posts_ids )){ $thebusiness_home_testimonial_args = array( 'post_type' => 'page', 'post__in' => $thebusiness_home_testimonial_posts_ids, 'posts_per_page' => $thebusiness_home_testimonial_number, 'orderby' => 'post__in' ); } } } // the query if( !empty( $thebusiness_home_testimonial_args )){ $thebusiness_home_testimonial_contents_array = array(); $thebusiness_home_testimonial_post_query = new WP_Query($thebusiness_home_testimonial_args); if ($thebusiness_home_testimonial_post_query->have_posts()) : $i = 0; while ($thebusiness_home_testimonial_post_query->have_posts()) : $thebusiness_home_testimonial_post_query->the_post(); $thumb_image =''; if(has_post_thumbnail()){ $thumb = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'thumbnail' ); $thumb_image = $thumb['0']; } $thebusiness_home_testimonial_contents_array[$i]['thebusiness-home-testimonial-title'] = get_the_title(); if (has_excerpt()) { $thebusiness_home_testimonial_contents_array[$i]['thebusiness-home-testimonial-content'] = get_the_excerpt(); } else { $thebusiness_home_testimonial_contents_array[$i]['thebusiness-home-testimonial-content'] = thebusiness_words_count( $thebusiness_home_testimonial_single_words ,get_the_content()); } $thebusiness_home_testimonial_contents_array[$i]['thebusiness-home-testimonial-image'] = $thumb_image; $thebusiness_home_testimonial_contents_array[$i]['thebusiness-home-testimonial-link'] = get_permalink(); if ($i == 0) { $thebusiness_home_testimonial_contents_array[$i]['thebusiness-testimonial-class'] = 'active'; } else{ $thebusiness_home_testimonial_contents_array[$i]['thebusiness-testimonial-class'] = ''; } $thebusiness_home_testimonial_contents_array[$i]['thebusiness-testimonial-slider-number'] = $i; $i++; endwhile; wp_reset_postdata(); endif; } return $thebusiness_home_testimonial_contents_array; } endif; if ( ! function_exists( 'thebusiness_home_testimonial' ) ) : /** * About Section * * @since theBusiness Pro 1.0.0 * * @param null * @return null * */ function thebusiness_home_testimonial() { global $thebusiness_customizer_all_values; if( (1 != $thebusiness_customizer_all_values['thebusiness-home-testimonial-enable']) ){ return; } $thebusiness_home_testimonial_selection_options = $thebusiness_customizer_all_values['thebusiness-home-testimonial-selection']; $thebusiness_testimonial_arrays = thebusiness_home_testimonial_array($thebusiness_home_testimonial_selection_options); if(1 == $thebusiness_customizer_all_values['thebusiness-home-testimonial-enable']) { if (is_array($thebusiness_testimonial_arrays)) { $thebusiness_home_testimonial_title = $thebusiness_customizer_all_values['thebusiness-home-testimonial-main-title']; $thebusiness_home_testimonial_number = absint( $thebusiness_customizer_all_values['thebusiness-home-testimonial-number'] ); $thebusiness_home_testimonial_slider_enable_control = $thebusiness_customizer_all_values['thebusiness-home-testimonial-enable-control']; ?>