true, 'category__in' => $cat_id, 'post_type' => 'post', 'posts_per_page' => 4, 'orderby' => 'ASC', ); break; default: break; } if ( 'demo' != $testimonial_content_type && 'custom' != $testimonial_content_type ) { // Fetch posts. $posts = get_posts( $args ); if ( ! empty( $posts ) ) { $i = 1; foreach ( $posts as $key => $post ) { $post_id = $post->ID; $content[ $i ]['title'] = get_the_title( $post_id ); $content[ $i ]['content'] = business_center_trim_content( 20, $post ); $content[ $i ]['link'] = get_permalink( $post_id ); $content[ $i ]['name_company'] = get_the_title( $post_id ); if ( has_post_thumbnail( $post_id ) ) { $featured_img = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ) ); $img_array = $featured_img[0]; } else { $img_array = ''; } if ( isset( $img_array ) ) { $content[$i]['img_array'][0] = $img_array; } $i++; } } } if ( ! empty( $content ) ) { $input = $content; } return $input; } endif; // Testimonial section content details. add_filter( 'business_center_filter_testimonial_section_details', 'business_center_get_testimonial_section_details' ); if ( ! function_exists( 'business_center_render_testimonial_section' ) ) : /** * Start testimonial section * * @return string Testimonial content * @since Business Center 1.0.0 * */ function business_center_render_testimonial_section( $content_details = array() ) { $options = business_center_get_theme_options(); if ( empty( $content_details ) ) { return; } ?>