File: /home/defaultwebsite/public/wp-content/themes/webgatha/archive-teams.php
<?php
/**
* The template for displaying archive pages
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package WebGatha
* @since 1.0.0
*/
get_header();
$filter_args = array(
'taxonomy' => 'team-category',
'fields' => 'id=>name',
);
$filter_terms = get_terms( $filter_args );
$team_layout = 'grid';
$unique_number = substr( md5( wp_rand( 0, 9999 ) ), 0, 9 );
$unique_class = 'webgatha-team-' . $unique_number;
$team_container_class = 'team-container';
if ( isset( $webgatha_options['team_layout'] ) && '' !== $webgatha_options['team_layout'] ) {
$team_layout = $webgatha_options['team_layout'];
}
$classes = ( 1 === (int) $webgatha_options['team_fullscreen'] ) ? 'container-fluid' : 'container';
if ( 'masonry' === $team_layout ) {
$team_container_class .= ' isotope-wrapper';
}
$area_col_classes = webgatha_column_classes();
$team_classes = webgatha_team_classes();
?>
<div class="<?php echo esc_attr( $classes ); ?>">
<div class="row">
<div class="<?php echo esc_attr( $area_col_classes ); ?>">
<div id="primary" class="content-area">
<main id="main" class="site-main">
<?php if ( have_posts() ) { ?>
<div class="<?php echo esc_attr( $team_container_class ); ?>" data-post_type="team" data-unique_class="<?php echo esc_attr( $unique_class ); ?>" data-layout="<?php echo esc_attr( $team_layout ); ?>">
<?php
if ( isset( $webgatha_options['display_team_categories_filters'] ) && 1 === (int) $webgatha_options['display_team_categories_filters'] && ! is_wp_error( $filter_terms ) && is_array( $filter_terms ) && ! empty( $filter_terms ) && isset( $webgatha_options['team_layout'] ) && 'masonry' === $webgatha_options['team_layout'] ) {
?>
<div class="row no-gutter">
<div class="col-sm-12">
<div class="isotope-filters">
<button data-filter="" class="all active"><?php echo esc_html__( 'All', 'webgatha' ); ?></button>
<?php
foreach ( $filter_terms as $filter_key => $filter_name ) {
?>
<button data-filter="<?php echo esc_attr( $filter_key ); ?>"><?php echo esc_html( $filter_name ); ?></button>
<?php
}
?>
</div>
</div>
</div>
<?php
}
?>
<div class="<?php echo esc_attr( $team_classes ); ?> <?php echo esc_attr( $unique_class ); ?>">
<div class="team-layout" data-layout="<?php echo esc_attr( $webgatha_options['team_layout'] ); ?>">
<?php
get_template_part( 'template-parts/teams/content', $team_layout );
?>
</div>
</div>
</div>
<?php
webgatha_team_pagination();
} else {
get_template_part( 'template-parts/content', 'none' );
}
?>
</main><!-- #main -->
</div><!-- #primary -->
</div>
<?php get_sidebar(); ?>
</div>
</div>
<?php
get_footer();