";
$taxFilterTerms = [];
if ( is_array( $department_ids ) && ! empty( $department_ids ) ) {
$taxFilterTerms = array_merge( $taxFilterTerms, $department_ids );
}
if ( ! empty( $designation_ids ) && is_array( $designation_ids ) ) {
$taxFilterTerms = array_merge( $taxFilterTerms, $designation_ids );
}
if ( $teamQuery->have_posts() ) {
if ( ! empty( $filters ) && ( $isGrid ) && ! $isSpecial ) {
$html .= "
";
if ( in_array( '_taxonomy_filter', $filters ) && $taxFilter ) {
$terms = Fns::rt_get_all_terms_by_taxonomy( $taxFilter );
$allSelect = ' selected';
$isTermSelected = false;
if ( $action_term && $taxFilter ) {
$isTermSelected = true;
$allSelect = null;
}
if ( ! $filterType || $filterType == 'dropdown' ) {
$html .= "
";
$termDefaultText = esc_html__( 'All', 'tlp-team' );
$dataTerm = 'all';
$htmlButton = '';
$htmlButton .= '';
if ( ! empty( $terms ) ) {
foreach ( $terms as $id => $term ) {
if ( $action_term == $id ) {
$dataTerm = $id;
}
if ( is_array( $taxFilterTerms ) && ! empty( $taxFilterTerms ) ) {
if ( in_array( $id, $taxFilterTerms ) ) {
if ( $action_term == $id ) {
$termDefaultText = $term;
$dataTerm = $id;
} else {
$htmlButton .= "{$term}";
}
}
} else {
if ( $action_term == $id ) {
$termDefaultText = $term;
$dataTerm = $id;
} else {
$htmlButton .= "{$term}";
}
}
}
}
if ( $isTermSelected ) {
$htmlButton .= "" . esc_html__(
'All',
'tlp-team'
) . '';
}
$htmlButton .= '';
$showAllhtml = '
' . $termDefaultText . '
';
$html .= $showAllhtml . $htmlButton;
$html .= '
';
} else {
$html .= "
";
if ( ! $hide_all_button ) {
$html .= "" . esc_html__(
'All',
'tlp-team'
) . '';
}
if ( ! empty( $terms ) ) {
foreach ( $terms as $id => $term ) {
$termSelected = null;
if ( $isTermSelected && $id == $action_term ) {
$termSelected = ' selected';
}
if ( is_array( $taxFilterTerms ) && ! empty( $taxFilterTerms ) ) {
if ( in_array( $id, $taxFilterTerms ) ) {
$html .= "{$term}";
}
} else {
$html .= "{$term}";
}
}
}
$html .= '
';
}
}
if ( in_array( '_sort_order', $filters ) ) {
$action_order = ( ! empty( $args['order'] ) ? strtoupper( trim( $args['order'] ) ) : 'DESC' );
$html .= '
';
$html .= " ";
$html .= '
';
}
if ( in_array( '_order_by', $filters ) ) {
$orders = Options::scOrderBy();
$action_orderby = ( ! empty( $args['orderby'] ) ? trim( $args['orderby'] ) : 'none' );
$action_orderby_label = ( $action_orderby == 'none' ? esc_html__(
'Sort By None',
'tlp-team'
) : $orders[ $action_orderby ] );
if ( $action_orderby !== 'none' ) {
$orders['none'] = esc_html__( 'Sort By None', 'tlp-team' );
}
$html .= '
';
$html .= "
{$action_orderby_label}
";
$html .= '';
foreach ( $orders as $orderKey => $order ) {
$html .= '' . $order . '';
}
$html .= '';
$html .= '
';
}
if ( in_array( '_search', $filters ) ) {
$html .= '
';
$html .= "";
$html .= "🔍";
$html .= "";
$html .= '
';
}
$html .= '
";
if ( $isIsotope && $isoFilterTaxonomy ) {
$terms = Fns::rt_get_all_terms_by_taxonomy( $isoFilterTaxonomy );
$htmlButton = null;
$fSelectTrigger = false;
if ( ! empty( $terms ) ) {
$sltIds = [];
if ( $isoFilterTaxonomy == rttlp_team()->taxonomies['department'] ) {
$sltIds = $department_ids;
} elseif ( $isoFilterTaxonomy == rttlp_team()->taxonomies['designation'] ) {
$sltIds = $designation_ids;
}
foreach ( $terms as $id => $term ) {
$fSelect = null;
if ( $tItem == $id ) {
$fSelect = 'class="selected"';
$fSelectTrigger = true;
}
$btn = "
';
if ( ! empty( $sltIds ) ) {
$htmlButton .= in_array( $id, $sltIds ) ? $btn : null;
} else {
$htmlButton .= $btn;
}
}
}
if ( $fShowAll && $htmlButton ) {
$fSelect = ( $fSelectTrigger ? null : 'class="selected"' );
$htmlButton = "
' . $htmlButton;
}
$html .= '
' . $htmlButton . '
';
$html .= "
";
}
if ( $isCarousel ) {
$autoPlay = ( in_array( 'autoplay', $cOpt, true ) ? true : false );
$stopOnHover = ( in_array( 'autoplayHoverPause', $cOpt, true ) ? true : false );
$nav = ( in_array( 'nav', $cOpt, true ) ? true : false );
$dots = ( in_array( 'dots', $cOpt, true ) ? true : false );
$loop = ( in_array( 'loop', $cOpt, true ) ? true : false );
$lazyLoad = ( in_array( 'lazy_load', $cOpt, true ) ? true : false );
$autoHeight = ( in_array( 'auto_height', $cOpt, true ) ? 1 : false );
$rtl = ( in_array( 'rtl', $cOpt, true ) ? true : false );
$rtlHtml = $rtl ? 'rtl' : 'ltr';
$hasDots = $dots ? ' has-dots' : ' no-dots';
$hasDots .= $nav ? ' has-nav' : ' no-nav';
$navPosition = 'top';
if ( 'carousel9' === $layout ) {
$navPosition = 'bottom';
}
$carouselClass = ( $layout != 'carousel10' ? 'swiper rttm-carousel-slider rt-pos-s ' . $navPosition . '-nav' . $hasDots : 'swiper rttm-carousel-main rt-pos-s' );
$sliderOptions = [
'slidesPerView' => (int) ! empty( $allCol['desktop'] ) ? absint( $allCol['desktop'] ) : 4,
'slidesPerGroup' => (int) 1,
'spaceBetween' => (int) 0,
'speed' => (int) absint( $speed ),
'loop' => (bool) $loop,
'autoHeight' => (bool) $autoHeight,
'rtl' => (bool) $rtl,
'preloadImages' => (bool) $lazyLoad ? false : true,
'lazy' => (bool) $lazyLoad ? true : false,
'breakpoints' => [
0 => [
'slidesPerView' => (int) ! empty( $allCol['mobile'] ) ? absint( $allCol['mobile'] ) : 1,
'pagination' => [
'dynamicBullets' => (bool) true,
],
],
767 => [
'slidesPerView' => (int) ! empty( $allCol['tab'] ) ? absint( $allCol['tab'] ) : 2,
'pagination' => [
'dynamicBullets' => (bool) false,
],
],
991 => [
'slidesPerView' => (int) ! empty( $allCol['desktop'] ) ? absint( $allCol['desktop'] ) : 4,
],
],
];
if ( 'carousel10' === $layout ) {
$sliderOptions['breakpoints'] = [
0 => [
'slidesPerView' => (int) ! empty( $allCol['mobile'] ) ? absint( $allCol['mobile'] ) : 1,
'pagination' => [
'dynamicBullets' => (bool) true,
],
],
767 => [
'slidesPerView' => (int) ! empty( $allCol['tab'] ) ? absint( $allCol['tab'] ) : 3,
'pagination' => [
'dynamicBullets' => (bool) false,
],
],
991 => [
'slidesPerView' => (int) ! empty( $allCol['desktop'] ) ? absint( $allCol['desktop'] ) : 5,
],
];
}
if ( $autoPlay ) {
$sliderOptions['autoplay'] = [
'delay' => (int) absint( $autoPlayTimeOut ),
'pauseOnMouseEnter' => (bool) $stopOnHover,
'disableOnInteraction' => (bool) false,
];
}
if ( 'carousel10' === $layout ) {
$html .= $this->renderThumbSlider( $scID, $teamQuery, $scMeta, $arg );
$html .= "
";
}
$html .= '
';
$html .= '
';
}
$l5loop = 0;
// layout 5 table
if ( $layout == 'layout5' ) {
$html .= "
";
}
if ( $isSpecial ) {
$html .= "";
$html .= "
";
$html .= "
";
$html .= "
";
}
$i = 1;
while ( $teamQuery->have_posts() ) :
$teamQuery->the_post();
if ( $layout == 'layout6' ) {
$arg['check'] = $this->check;
}
/* Argument for single member */
$mID = get_the_ID();
$arg['mID'] = $mID;
$arg['title'] = get_the_title();
$cLink = get_post_meta( $mID, 'ttp_custom_detail_url', true );
$arg['pLink'] = ( $cLink ? $cLink : get_permalink() );
$arg['designation'] = wp_strip_all_tags(
get_the_term_list(
$mID,
rttlp_team()->taxonomies['designation'],
null,
', '
)
);
$arg['email'] = get_post_meta( $mID, 'email', true );
$arg['web_url'] = get_post_meta( $mID, 'web_url', true );
$arg['telephone'] = get_post_meta( $mID, 'telephone', true );
$arg['mobile'] = get_post_meta( $mID, 'mobile', true );
$arg['fax'] = get_post_meta( $mID, 'fax', true );
$arg['location'] = get_post_meta( $mID, 'location', true );
$short_bio = get_post_meta( $mID, 'short_bio', true );
$arg['ttp_my_resume'] = get_post_meta( $mID, 'ttp_my_resume', true );
$arg['ttp_hire_me'] = get_post_meta( $mID, 'ttp_hire_me', true );
$arg['short_bio'] = Fns::get_ttp_short_description( $short_bio, $character_limit, $after_short_desc );
$social = get_post_meta( $mID, 'social', true );
$arg['sLink'] = $social ? $social : [];
$skill = get_post_meta( $mID, 'skill', true );
$arg['tlp_skill'] = $skill ? maybe_unserialize( $skill ) : [];
$arg['imgHtml'] = ! $fImg ? Fns::getFeatureImageHtml( $mID, $fImgSize, $defaultImgId, $customImgSize, $lazyLoad ) : null;
if ( ! $arg['imgHtml'] ) {
$arg['content_area'] = 'rt-col-md-12';
}
$arg['i'] = $i;
$arg['isoFilter'] = '';
if ( $isIsotope && $isoFilterTaxonomy ) {
$termAs = wp_get_post_terms( $mID, $isoFilterTaxonomy, [ 'fields' => 'all' ] );
$isoFilter = null;
if ( ! empty( $termAs ) ) {
foreach ( $termAs as $term ) {
$isoFilter .= ' ' . 'iso_' . $term->term_id;
}
}
$arg['isoFilter'] = $isoFilter;
}
$html .= Fns::render( 'layouts/' . $layout, $arg, true );
$l5loop++;
if ( $l5loop == 2 ) {
$l5loop = 0;
if ( $this->check == 1 ) {
$this->check = 0;
} else {
$this->check = 1;
}
}
$i++;
endwhile;
if ( $isSpecial ) {
$html .= '
'; // End row
$html .= '
'; // End col
$html .= '
'; // End rt-special-wrapper
}
if ( $layout == 'layout5' ) {
$html .= '
';
}
if ( $isIsotope ) {
$html .= '
'; // end of Isotope.
}
if ( $isCarousel ) {
$html .= '
';
$navHtml = '
';
if ( 'carousel10' === $layout ) {
$navHtml = '
';
}
$html .= $nav ? $navHtml : '';
$html .= $dots ? '' : '';
if ( 'carousel10' === $layout ) {
$html .= '
';
}
$html .= '
'; // end of carousel.
}
$html .= $preLoaderHtml;
$html .= '
'; // end row tlp-team
if ( $pagination && ! $isCarousel ) {
$htmlUtility = null;
$postPp = $teamQuery->query_vars['posts_per_page'];
$page = $teamQuery->query_vars['paged'];
$foundPosts = $teamQuery->found_posts;
$morePosts = $foundPosts - ( $postPp * $page );
$totalPage = $teamQuery->max_num_pages;
$foundPost = $teamQuery->found_posts;
if ( ! rttlp_team()->has_pro() ) {
$posts_loading_type = 'pagination';
}
if ( $scMeta['ttp_limit'][0] ) {
$range = $scMeta['ttp_posts_per_page'][0];
$foundPost = $teamQuery->found_posts;
if ( $range && $foundPost > $range ) {
$foundPost = $scMeta['ttp_limit'][0];
$totalPage = ceil( $foundPost / $range );
}
}
$morePosts = $foundPost - ( $postPp * $page );
$foundPosts = $foundPost;
$totalPage = absint( $totalPage );
$morePosts = absint( $morePosts );
$hide = ( $teamQuery->max_num_pages < 2 ? ' rt-hidden-elm' : null );
if ( $posts_loading_type == 'pagination' && $isGrid && empty( $filters ) ) {
$htmlUtility .= Fns::custom_pagination(
$totalPage,
$postPp
);
} elseif ( $posts_loading_type == 'pagination_ajax' && ! $isIsotope ) {
$htmlUtility .= "
";
} elseif ( $posts_loading_type == 'load_more' ) {
$htmlUtility .= "
";
} elseif ( $posts_loading_type == 'load_on_scroll' ) {
$htmlUtility .= "
";
}
if ( $htmlUtility ) {
$html .= '';
}
}
wp_reset_postdata();
} else {
$html .= '
' . esc_html__( 'No member found', 'tlp-team' ) . '