How to display image inside WPBakery param_group ? when i add this code it’s show me image id

Question

enter image description here
This is my shortcode

<?php 
/**
 *Testimonial shortcode for our theme 
*/
function testimonial_func( $atts , $content ){
  extract( shortcode_atts( array( 
    'section_id'      => '',
    'section_title'   => __( 'Happy Clients', 'jonypro' ),

    //testimonail options
    'client_group'      => '',
    'client_img'        => get_template_directory_uri() . '/assets/images/testimonial/user.png',
    'client_name'       => __( 'forthmedia' , 'jonypro' ),
    'client_star'       => get_template_directory_uri() . '/assets/images/testimonial/star.png',
    'client_review'     => __( 'Very impressed with the speed and quality of work. If you are looking to convert psd, jpg, png to html and have it be responsive this is the right gig for you.' , 'jonypro' ),
   ) , $atts ) ); 

  ob_start();
?>

  <!-- Testimonial Start -->
  <div id="<?php echo esc_attr( $section_id ); ?>" class="rs-testimonial testimonials-slider gray-color sec-spacer dark-testimonial">
    <div class="container">

      <div class="row">
        <div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2 col-xs-12">
          <div class="sec-title text-center">
            <h3><?php echo esc_html( $section_title ); ?></h3> 
          </div>
        </div>
      </div>

      <div class="row">
        <div class="col-sm-12 text-center">
          <div class="testimonials-list owl-carousel">
            <?php 
              $clients = vc_param_group_parse_atts( $client_group ) ;

              if( is_array( $clients ) ) : 
                foreach( $clients as $client ) :
                  
            ?>
                  <div class="single-testimonils">
                    <img src="<?php echo $client['client_img']; ?>">
                    <p><?php echo esc_html( $client[ 'client_review' ] ); ?></p>
                    <ul class="author-info">
                      <li><?php echo esc_html( $client[ 'client_name' ] ); ?></li>
                      <li><img class="client_star" src="<?php echo $client[ 'client_star' ]; ?>" alt="star"></li>
                    </ul>
                  </div>

                <?php endforeach; ?>
              <?php endif; ?>

          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- Testimonial Start -->
    

<?php 
  return ob_get_clean();
}
add_shortcode( 'jonypro_testimonial_shortcode', 'testimonial_func' );

This is my wpbakery code

/********* WPBakery elements *********/
        function testimonail_elements(){
          vc_map( array(
            'base'      => 'jonypro_testimonial_shortcode',
            'name'      => __( 'Testimonial Section', 'jonypro' ),
            'category'  => __( 'JonyPro Elements', 'jonypro' ),
            'params'    => array(
              array(
                'param_name'  => 'section_id',
                'type'        => 'textfield',
                'heading'     => __( 'Section ID', 'jonypro' ),
              ),
              // end section id
        
              array(
                'param_name'  => 'section_title',
                'type'        => 'textfield',
                'heading'     => __( 'Section ID', 'jonypro' ),
                'value'       => __( 'Happy Clients', 'jonypro' ),
              ),
              // end section title
        
              array(
                'param_name'  => 'client_group',
                'type'        => 'param_group',
                'heading'     => __( 'Add Client Review', 'jonypro' ),
                'group'       => 'Client Reviews',
                'params'      => array( 
                  array(
                    'param_name'  => 'client_img',
                    'type'        => 'attach_image',
                    'heading'     => __( 'Add Client Image', 'jonypro' ),
                    'value'       => get_template_directory_uri() . '/assets/images/testimonial/user.png',
                  ),
                  // end client img
                  
                  array(
                    'param_name'  => 'client_name',
                    'type'        => 'textfield',
                    'heading'     => __( 'Add Client Name', 'jonypro' ),
                    'value'       => __( 'forthmedia' , 'jonypro' ),
                  ),
                  // end client img
        
                  array(
                    'param_name'  => 'client_star',
                    'type'        => 'attach_image',
                    'heading'     => __( 'Add Client Star', 'jonypro' ),
                    'value'       => get_template_directory_uri() . '/assets/images/testimonial/star.png',
                  ),
                  // end client img
        
                  array(
                    'param_name'  => 'client_review',
                    'type'        => 'textarea',
                    'heading'     => __( 'Add Client Review', 'jonypro' ),
                    'value'       => __( 'Very impressed with the speed and quality of work. If you are looking to convert psd, jpg, png to html and have it be responsive this is the right gig for you.' , 'jonypro' ),
                  ),
                  // end client review
        
                )
              ),
              // end client group here
        
            ),
          ) );
        }
        add_action( 'vc_before_init' , 'testimonail_elements' );
0
Johny 7 months 2020-07-26T02:10:49-05:00 0 Answers 67 views 0

Leave an answer