<?php
get_header();
get_template_part('template_inc/inc', 'header');
//get_template_part('template_inc/inc', 'breadcrumb');

?>
<div class="tzteamDefault">
    <?php
    $interiart_tzteam_image = ot_get_option('interiart_tzteam_image');
    ?>
    <div class="tzteam_image" style="background-image: url('<?php echo esc_attr($interiart_tzteam_image); ?>') ">
        <?php if ($interiart_tzteam_image != '') : ?>
            <div class="tz_empty"></div>
        <?php endif; ?>
    </div>
    <div class="container">
        <div class="row">
            <?php
            $interiart_team_title = ot_get_option('interiart_tzTeam_title');
            $interiart_team_des = ot_get_option('interiart_TzTeam_des');
            $interiart_team_nav = ot_get_option('interiart_TzTeam_nav');
            $interiart_team_num = ot_get_option('interiart_tzTeam_num');
            $interiart_TzTeam_orderby = ot_get_option('interiart_TzTeam_orderby');
            $interiart_TzTeam_order = ot_get_option('interiart_TzTeam_order');
            $interiart_TzTeam_column = ot_get_option('interiart_TzTeam_column');

            if ($interiart_TzTeam_column == '2') {
                $interiart_column_class = 'col-md-6';
            } elseif ($interiart_TzTeam_column == '3') {
                $interiart_column_class = 'col-md-4';
            } elseif ($interiart_TzTeam_column == '4') {
                $interiart_column_class = 'col-md-3';
            }
            ?>
            <div class="tz_team_head">
                <?php if ($interiart_team_title != '') : ?>
                    <h3><?php echo esc_html($interiart_team_title); ?></h3>
                <?php endif; ?>
                <?php if ($interiart_team_des != '') : ?>
                    <p><?php echo balanceTags($interiart_team_des); ?></p>
                <?php endif; ?>
            </div>
            <div class="tzteamContainer">


                <?php

                $args = array(
                    'post_type' => 'team',
                    'paged' => get_query_var('paged'),
                    'posts_per_page' => $interiart_team_num,
                    'orderby' => $interiart_TzTeam_orderby,
                    'order' => $interiart_TzTeam_order,

                );

                $query = new WP_Query($args);
                if ($query->have_posts()): while ($query->have_posts()): $query->the_post();


                    $interiart_team_position = get_post_meta(get_the_ID(), 'interiart_team_position', true);


                    ?>

                    <div id='post-<?php the_ID(); ?>'
                         class="tzteamItem .col-1 col-sm-4 <?php echo esc_attr($interiart_column_class); ?>">

                        <div class="tzteamImage">
                            <a href="<?php the_permalink(); ?>" target="_blank">
                                <?php the_post_thumbnail(); ?>
                            </a>
                        </div>
                        <?php

                        ?>
                        <div class="tzteamContent">

                            <h3 class="tz_title"><a href="<?php the_permalink(); ?>"
                                                    target="_blank"><?php the_title(); ?></a></h3>
                            <p class="tz_position">
                                <?php
                                echo esc_html($interiart_team_position);
                                ?>
                            </p>

                        </div>

                    </div>
                <?php
                endwhile; // end while ( have_posts )
                endif; // end if ( have_posts )
                ?>
            </div>
            <?php
            if ($interiart_team_nav != 'no') :
                if (function_exists('wp_pagenavi')):
                    wp_pagenavi();
                else:
                    interiart_content_nav('bottom-nav');
                endif;
            endif;
            ?>
        </div>
    </div>
</div>
<?php
interiart_footer_type();
get_footer();
?>

