OwlCyberSecurity - MANAGER
Edit File: testimonials.php
<?php /** * Testimonials */ add_shortcode( 'pearl_testimonials_list', 'pearl_testimonials_list' ); function pearl_testimonials_list( $atts ) { extract( shortcode_atts( array( 'heading' => '', 'number_of_posts' => 3, 'font_color' => 'dark-testi', ), $atts ) ); ob_start(); ?> <div class="patients-testi <?php echo sanitize_html_class( $font_color ); ?>"> <div class="container"> <?php if ( ! empty( $heading ) ) { ?> <div class="row"> <div class="col-md-12"> <div class="main-title main-title2"> <h2><?php echo sanitize_text_field( $heading ); ?></h2> </div> </div> </div> <?php } ?> <div id="testimonials"> <div class="container"> <div class="row"> <div class="col-md-12"> <div class="span12"> <div id="owl-demo2" class="owl-carousel"> <?php $testimonials_args = array( 'post_type' => 'testimonial', 'posts_per_page' => $number_of_posts ); $testimonials = new WP_Query( $testimonials_args ); if ( $testimonials->have_posts() ) { while ( $testimonials->have_posts() ) { $testimonials->the_post(); $meta_data = get_post_custom(); ?> <div class="testi-sec"> <?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'pearl_image_size_270_270' ); } ?> <div class="height10"></div> <?php if ( ! empty( $meta_data['PEARL_META_patient_name'] ) ) : echo '<span class="name">' . $meta_data['PEARL_META_patient_name'][0] . '</span>'; endif; if ( ! empty( $meta_data['PEARL_META_the_patient'] ) ) : echo '<span class="patient">' . $meta_data['PEARL_META_the_patient'][0] . '</span>'; endif; if ( ! empty( $meta_data['PEARL_META_testimonial_text'] ) ) : echo '<div class="height30"></div>'; echo '<p>' . $meta_data['PEARL_META_testimonial_text'][0] . '</p>'; endif; ?> <div class="height35"></div> </div> <?php } } ?> </div> </div> </div> </div> </div> </div> </div> </div> <?php return ob_get_clean(); } /** * Testimonials List */ vc_map( array( "name" => esc_html__( "Pearl Testimonials", 'pearl-medical-framework' ), "base" => "pearl_testimonials_list", "class" => "", "category" => esc_html__( "MedicalGuide Theme", 'pearl-medical-framework' ), "params" => array( array( "type" => "textfield", "class" => "", "heading" => esc_html__( "Heading", 'pearl-medical-framework' ), "param_name" => "heading", "value" => "", "description" => esc_html__( "Provide testimonial section heading.", 'pearl-medical-framework' ), "admin_label" => true ), array( "type" => "dropdown", "class" => "", "heading" => esc_html__( "Number of Testimonials to display", 'pearl-medical-framework' ), "param_name" => "number_of_posts", "value" => array( 1, 2, 3, 4, 5, 6, 7, 8 ), "description" => esc_html__( "Select a number of testimonials posts you want to display.", 'pearl-medical-framework' ), "admin_label" => true ), array( "type" => "dropdown", "class" => "", "heading" => esc_html__( "Font Color", 'pearl-medical-framework' ), "param_name" => "font_color", "value" => array( 'White' => 'dark-testi', 'Dark' => 'dark-testimonial' ), "admin_label" => true ) ) ) );