Current Path : /var/test/www/ooareogundevinitiative/wp-content/themes/pain/framework/shortcodes/team/ |
Current File : /var/test/www/ooareogundevinitiative/wp-content/themes/pain/framework/shortcodes/team/team.php |
<?php function jwsthemes_team_slider_func($atts, $content = null) { extract(shortcode_atts(array( 'columns' => 4, 'el_class' => '', 'category' => '', 'posts_per_page' =>'-1', 'orderby' => 'none', 'order' => 'none', 'show_title' => 0, 'show_meta' => 0, 'show_pagination' => 0, ), $atts)); $class = array(); $class[] = 'jw-team-wrapper clearfix'; $class[] = $el_class; $paged = is_front_page() ? get_query_var( 'page' ) : get_query_var( 'paged' ); $args = array( 'posts_per_page' => $posts_per_page, 'paged' => $paged, 'orderby' => $orderby, 'order' => $order, 'post_type' => 'team', 'post_status' => 'publish'); if (isset($category) && $category != '') { $cats = explode(',', $category); $category = array(); foreach ((array) $cats as $cat) : $category[] = trim($cat); endforeach; $args['tax_query'] = array( array( 'taxonomy' => 'team_category', 'field' => 'id', 'terms' => $category ) ); } $wp_query = new WP_Query($args); ob_start(); if ( $wp_query->have_posts() ) { $class_columns = ''; switch ($columns) { case 1: $class_columns = 'col-xs-6 col-sm-12 col-md-12 col-lg-12'; break; case 2: $class_columns = 'col-xs-6 col-sm-6 col-md-6 col-lg-6'; break; case 3: $class_columns = 'col-xs-6 col-sm-12 col-md-4 col-lg-4'; break; case 4: $class_columns = 'col-xs-6 col-sm-6 col-md-3 col-lg-3'; break; default: $class_columns = 'col-xs-6 col-sm-6 col-md-3 col-lg-3'; break; } ?> <div class="<?php echo esc_attr(implode(' ', $class)); ?>"> <div class="jw-team"> <div class="row"> <?php while ( $wp_query->have_posts() ) { $wp_query->the_post(); ?> <div class="<?php echo esc_attr($class_columns); ?> jws-team-item"> <article <?php post_class(); ?>> <?php if ( has_post_thumbnail() ) the_post_thumbnail('jws-imge-crop-thumbnail-team'); ?> <?php if($show_title) { ?> <div class="jws-title-team"> <h3 class="jw-title"><?php the_title(); ?></h3> <span class="jw-position"><?php echo get_post_meta(get_the_ID(),'tb_team_experience',true); ?></span> </div> <?php } ?> <?php if($show_meta) { ?> <div class="jw-meta"> <h3 class="jw-title"><a href="<?php the_permalink();?>"><?php the_title(); ?></a></h3> <span class="jw-position"><?php echo get_post_meta(get_the_ID(),'tb_team_experience',true); ?></span> <div class="team-expect"><?php the_excerpt();?></div> <div class="jw-phone"><?php echo '<i class="fa fa-phone"></i>'.get_post_meta(get_the_ID(),'tb_team_phone',true); ?></div> </div> <?php } ?> </article> </div> <?php } ?> </div> </div> <?php if($show_pagination){ ?> <nav class="jw-pagination" role="navigation"> <?php $big = 999999999; // need an unlikely integer echo paginate_links( array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var('paged') ), 'total' => $wp_query->max_num_pages, 'prev_text' => __( '<i class="fa fa-angle-double-left"></i>', 'pain' ), 'next_text' => __( '<i class="fa fa-angle-double-right"></i>', 'pain' ), ) ); ?> </nav> <?php } ?> </div> <?php } return ob_get_clean(); } if(function_exists('bcore_shortcode')) { bcore_shortcode('team', 'jwsthemes_team_slider_func'); }