Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Team Members Post Template
- *
- * @package WordPress
- * @subpackage Visual Composer Starter
- * @since Visual Composer Starter 1.0
- */
- get_header(); ?>
- <div class="container">
- <div class="content-wrapper">
- <div class="row">
- <div class="col-md-12">
- <div class="main-content">
- <div class="archive">
- <div class="team-grid-wrapper">
- <?php
- $queried_object = get_queried_object();
- $taxonomy = $queried_object->taxonomy;
- $term_id = $queried_object->term_id;
- $term_sort_id = get_field( 'team_category_sort_order', $taxonomy . '_' . $term_id );
- $args = array(
- 'taxonomy' => 'team_category',
- 'orderby' => 'meta_value_num',
- 'meta_compare' => 'NUMERIC',
- 'order' => 'DESC',
- 'meta_key' => 'team_category_sort_order'
- );
- $_terms = get_terms( $args );
- foreach ($_terms as $term) :
- $term_slug = $term->slug;
- $_posts = new WP_Query( array(
- 'post_type' => 'team_members',
- 'order' => 'ASC',
- 'orderby' => 'menu_order',
- 'tax_query' => array(
- array(
- 'taxonomy' => 'team_category',
- 'field' => 'slug',
- 'terms' => $term_slug,
- ),
- ),
- ));
- if( $_posts->have_posts() ) :
- ?>
- <div class="teamcat <?php if( $teamcounter % 2 == 0 ) : echo 'bluebg-row'; else : endif; ?> teamcategory-<?php echo $term->slug; ?>">
- <h2 class="teamcat-heading"><?php echo $term->name ?> <span style="border: 1px solid black"><?php if($term_sort_id) {echo $term_sort_id;}else{echo 'empty';} ?></span></h2>
- <br>
- <div class="teamcat-items teamcategory-<?php echo $term->slug; ?>-items">
- <?php while ( $_posts->have_posts() ) : $_posts->the_post(); ?>
- <?php
- $linkorno = get_field('team_bio');
- $linkurl = get_permalink();
- ?>
- <div class="team-member-wrapper">
- <div class="team-member-image-wrapper">
- <?php the_post_thumbnail( 'full' ); ?>
- </div>
- <div class="team-member-content-wrapper">
- <h3 class="team-member-name">
- <?php if( $linkorno ): ?><a href="<?php the_permalink(); ?>"><?php endif; ?>
- <?php the_title(); ?>
- <?php if( $linkorno ): ?></a><?php endif; ?>
- </h3>
- <span><?php the_field('team_title'); ?></span>
- <span><?php the_field('team_phone_number'); ?></span>
- <span><?php the_field('team_email'); ?></span>
- </div>
- </div>
- <?php endwhile; ?>
- </div>
- </div>
- <?php
- endif;
- wp_reset_postdata();
- endforeach;
- ?>
- </div><!-- team grid wrapper -->
- </div><!--archive -->
- </div><!-- main-content -->
- </div><!-- col-md-12 -->
- </div> <!-- row -->
- </div><!-- content-wrapper -->
- </div><!-- container -->
- <?php
- get_footer();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement