<?php
/* ==========================================================
  Testimonials
=========================================================== */
if ( !function_exists('confin_team_member_items_function')) {
  function confin_team_member_items_function( $atts, $content = NULL ) {
    extract($atts);

    $e_uniqid       = uniqid();
    $inline_style   = '';

    // add inline style
    add_inline_style( $inline_style );
    $styled_class  = 'testimonials-wrap-'.$e_uniqid.' ';


     ob_start();
     if ($all_members) {
     ?>
        <!-- start team-section -->
        <section class="team-section">
          <div class="row">
              <div class="col col-xs-12">
                  <div class="team-grids clearfix">

                  <?php
                    foreach ($all_members as $key => $member) {
                      if (isset($member->team_profile) && !empty($member->team_profile)) {
                      ?>
                      <div class="grid">
                        <?php if($member->team_profile){ ?>
                          <div class="member-pic">
                            <img src="<?php echo wp_get_attachment_url( $member->team_profile ); ?>" alt>
                          </div>
                        <?php } ?>
                          <div class="details">
                            <?php
                            if($member->member_name){
                              echo '<h3>'.esc_html( $member->member_name ).'</h3>';
                            }
                            if($member->member_title){
                              echo '<p>'.esc_html( $member->member_title ).'</p>';
                            }
                            ?>
                          </div>
                      </div>
                  <?php } } ?>
                  </div>
              </div>
          </div>
        </section>
        <!-- end team-section -->

    <?php
    }
     return ob_get_clean();
  }
}
add_shortcode( 'team_member', 'confin_team_member_items_function' );
