| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- <?php
- /*------------------------------------------------------*/
- /* taskereasy Testimonials
- /*------------------------------------------------------*/
- vc_map(array(
- "name" => esc_html__("Testimonials", 'taskereasy'),
- "base" => "taskereasy_testimonials",
- 'icon' => get_template_directory_uri() . '/assets/images/favicon-icon/shortcode-icon.png',
- "class" => "",
- "description" => esc_html__("Add taskereasy Testimonials", 'taskereasy'),
- "category" => esc_html__('Taskereasy Shortcodes', 'taskereasy'),
- "params" => array(
- array(
- 'type' => 'dropdown',
- 'heading' => esc_html__( 'Columns', 'taskereasy' ),
- 'param_name' => 'testi_col',
- 'value' => array('Single' => 'single', 'Multiple' => 'multi'),
- ),
- array(
- 'type' => 'dropdown',
- 'heading' => esc_html__( 'Style', 'taskereasy' ),
- 'param_name' => 'style',
- 'value' => array('Style One' => 'style_1', 'Style Two' => 'style_2'),
- 'dependency' => array(
- 'element' => 'testi_col',
- 'value' => 'single'
- )
- ),
- array(
- "type" => "param_group",
- "heading" => esc_html__("Testimonial", 'taskereasy'),
- "param_name" => "testimonial",
- "params" => array(
- array(
- "type" => "attach_image",
- "heading" => esc_html__("Image", 'taskereasy'),
- "param_name" => "image",
- ),
- array(
- 'type' => 'textfield',
- 'heading' => esc_html__( 'Author', 'taskereasy' ),
- 'param_name' => 'author',
- ),
- array(
- "type" => "textarea_safe",
- "heading" => esc_html__("Description", 'taskereasy'),
- "param_name" => "description",
- ),
- array(
- 'type' => 'textfield',
- 'heading' => esc_html__( 'Position', 'taskereasy' ),
- 'param_name' => 'position',
- ),
- ),
- ),
- array(
- 'type' => 'css_editor',
- 'heading' => esc_html__( 'CSS', 'taskereasy' ),
- 'param_name' => 'custom_design',
- 'group' => esc_html__( 'Design options', 'taskereasy' ),
- )
- )
- ));
- add_shortcode( 'taskereasy_testimonials', function($atts, $content = null) {
- extract(shortcode_atts(array(
- 'testi_col' => 'single',
- 'style' => 'style_1',
- 'image' => '',
- 'description' => '',
- 'author' => '',
- 'position' => '',
- 'align' => '',
- 'title_heading' => 'h1',
- 'titlecolor' => '',
- 'title_align' => '',
- 'description_color' => '',
- 'custom_design' => '',
- ), $atts));
- $custom_design = vc_shortcode_custom_css_class( $custom_design, ' ' );
- $output = '';
- $count = 0;
- $testimonials = vc_param_group_parse_atts( $atts['testimonial'] );
- $testicol = html_entity_decode(vc_value_from_safe($testi_col, true));
- $test_id = ($testicol == 'multi') ? 'testimonialsTwo' : 'testimonials';
- $output .= '<div id="'.$test_id.'" class="'.$style.'">';
- if($testicol == 'single' ){
- if(empty($style) || $style == 'style_1'){
- $output .='<div class="owl-carousel">';
- foreach ($testimonials as $testimonial) {
- $img_id = $testimonials[$count]['image'];
- $imgurl = wp_get_attachment_image_src($img_id);
- $output .= '<div class="item">
- <div class="reviews-box">';
- if($imgurl[0]){
- $output .='<div class="client-imge"> <img src="'.$imgurl[0].'" alt="image"> </div>';
- }
- $output .= '<div class="review-box-inner"><h6>'.$testimonials[$count]['author'].'</h6>
- <div class="client-m">'.$testimonials[$count]['position'].'</div>
- <p>'.$testimonials[$count]['description'].'</p></div>
- </div> </div>';
- $count++;
- }
- $output .= '</div>';
- }else{
- $output .='<div class="testimonial-slider">';
- foreach ($testimonials as $testimonial) {
- $img_id = $testimonials[$count]['image'];
- $imgurl = wp_get_attachment_image_src($img_id);
- $output .= '
- <div class="testimonial-items">
- <div class="users-quote">
- '.$testimonials[$count]['description'].'
- </div>
- <div class="users-profile">
- <div class="users-img-inner">';
- if($imgurl[0]){
- $output .='<img src="'.$imgurl[0].'" alt="image">';
- }
- $output.='
- </div>
- <div class="users-info">
- <p class="user-name"><b>'.$testimonials[$count]['author'].'</b></p>
- <p class="user-state">'.$testimonials[$count]['position'].'</p>
- <p class="user-rating"><i class="fa fa-star" aria-hidden="true"></i><i class="fa fa-star" aria-hidden="true"></i><i class="fa fa-star" aria-hidden="true"></i><i class="fa fa-star" aria-hidden="true"></i></p>
- </div>
- </div>
- </div>';
- $count++;
- }
- $output .='</div>';
- }
- }else{
- $output .='<div class="owl-carousel">';
- foreach ($testimonials as $testimonial) {
- $img_id = $testimonials[$count]['image'];
- $imgurl = wp_get_attachment_image_src($img_id);
- $output .= '<div class="item">
- <div class="testimonial-wrap">
- <div class="testimonial-header">
- <div class="testimonial-img">';
- if($imgurl[0]){
- $output .= '<img src="'.$imgurl[0].'" alt="image">';
- }
- $output .= '</div>
- <h6>'.$testimonials[$count]['author'].'</h6>
- <p>'.$testimonials[$count]['position'].'</p>
- <div class="ratings">
- <i class="fa fa-star active"></i>
- <i class="fa fa-star active"></i>
- <i class="fa fa-star active"></i>
- <i class="fa fa-star active"></i>
- <i class="fa fa-star"></i>
- </div>
- </div>
- <div class="testimonial-body">
- <p>'.$testimonials[$count]['description'].'</p>
- </div>
- </div>
- </div>';
- $count++;
- }
- $output .= '</div>';
- }
- $output .= '</div>';
- return $output;
- });
|