$item_classes = '';
    switch ($columns) {
        case 1:
            $item_classes = 'col-xs-12';
            break;
        case 2:
            $item_classes = 'col-xs-12 col-sm-6';
            break;
        case 3:
            $item_classes = 'col-xs-12 col-sm-6 col-md-4';
            break;
        case 4:
            $item_classes = 'col-xs-12 col-sm-6 col-md-4 col-lg-3';
            break;
    }
    $args = array('paged' => ci_get_page_var(), 'post_type' => $cpt);
    if ($posts_per_page >= 1) {
        $args['posts_per_page'] = $posts_per_page;
    } elseif ($posts_per_page <= -1) {
        $args['posts_per_page'] = -1;
    }
    if ('on' == $isotope) {
        $args['posts_per_page'] = -1;
    }
    $full_width_class = 1 == $columns ? ' item-fullwidth ' : '';
    $q = new WP_Query($args);
    ?>

						<?php 
    while ($q->have_posts()) {
        $q->the_post();
$item_classes = '';
switch ($columns) {
    case 1:
        $item_classes = 'col-xs-12';
        break;
    case 2:
        $item_classes = 'col-xs-12 col-sm-6';
        break;
    case 3:
        $item_classes = 'col-xs-12 col-sm-6 col-md-4';
        break;
    case 4:
        $item_classes = 'col-xs-12 col-sm-6 col-md-4 col-lg-3';
        break;
}
$args = array('paged' => ci_get_page_var(), 'post_type' => $cpt, 'tax_query' => array(array('taxonomy' => $cpt_taxonomy, 'terms' => $term->term_id, 'include_children' => true)));
if ('on' == $isotope) {
    $args['posts_per_page'] = -1;
}
$full_width_class = 1 == $columns ? ' item-fullwidth ' : '';
if (!empty($isotope)) {
    query_posts($args);
}
?>

					<?php 
while (have_posts()) {
    the_post();
    ?>

						<?php 
<?php 
get_header();
?>

<main id="main">
	<div class="container">
		<div class="row">
			<div class="col-xs-12">
				<?php 
get_template_part('inc_section_titles');
?>

				<div class="row item-list">
					<?php 
$args = array('post_type' => 'post', 'paged' => ci_get_page_var());
$posts = new WP_Query($args);
?>
					<?php 
if ($posts->have_posts()) {
    while ($posts->have_posts()) {
        $posts->the_post();
        ?>
						<div class="<?php 
        echo esc_attr(ci_setting('layout_blog_columns'));
        ?>
">
							<div class="item cpt_post <?php 
        echo ci_setting('layout_blog_columns') == '' ? 'item-fullwidth' : '';
        ?>
">
						</div>
					<?php 
    }
    ?>

					<?php 
    if ('on' == $events_past) {
        ?>
						<div class="event-list">
							<h3 class="section-title"><?php 
        echo $events_past_title;
        ?>
</h3>

							<?php 
        $past_events_args = array('post_type' => $cpt, 'paged' => ci_get_page_var(), 'meta_key' => 'ci_cpt_event_date', 'meta_value' => date_i18n('Y-m-d'), 'meta_compare' => '<', 'orderby' => 'meta_value', 'order' => 'DESC');
        if ($posts_per_page >= 1) {
            $past_events_args['posts_per_page'] = $posts_per_page;
        } elseif ($posts_per_page <= -1) {
            $past_events_args['posts_per_page'] = -1;
        }
        if ('on' == $isotope) {
            $past_events_args['posts_per_page'] = -1;
        }
        $past_events = new WP_Query($past_events_args);
        ?>

							<?php 
        if ('on' == $isotope) {
            ?>
								<ul class="filters-nav group">
											<?php 
            ci_the_post_thumbnail(array('noalign' => true));
            ?>
										</a>
									</figure>
								<?php 
        }
        ?>

								<div class="entry-content">
									<?php 
        the_content();
        ?>

									<?php 
        $q = new WP_Query(array('paged' => ci_get_page_var(), 'ignore_sticky_posts' => 1, 'showposts' => ci_setting('archive_no')));
        ?>
									<h2><?php 
        _e('Latest posts', 'ci_theme');
        ?>
</h2>
									<ul class="lst archive">
										<?php 
        while ($q->have_posts()) {
            $q->the_post();
            ?>
											<li><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();