<?php 
/**
 * Titan category page
**/ 
?>
<?php get_header();
$t1t_category_post_style = get_option('t1t_category_post_style');
$author_show  = get_option('t1t_category_show_author');
$date_show  = get_option('t1t_category_show_date');
$t1t_category_big_post = get_option('t1t_category_big_post');
?>
<div id="main">
	<div id="primary" class="three-parts archive">
		<?php if($t1t_category_big_post == 'false'){?>
		<div class="widget-title">
			<h1>
				<?php echo get_option('t1t_word_before_category'); ?>
				<?php single_cat_title(); ?>
			</h1>
		</div>
		<!--widget-title-->
		<?php } ?>
		
		<?php 
			$page = (get_query_var('paged')) ? get_query_var('paged') : 1;
			
			
			if($t1t_category_big_post == 'true'){
				$t1t_category_big_post_style = get_option('t1t_category_big_post_style');	
				$category_id = get_cat_id( single_cat_title("",false) ); $t1t_posts = new WP_Query(array( 'cat' => $category_id, 'posts_per_page' => '1')); while($t1t_posts->have_posts()) : $t1t_posts->the_post();
												
			if($page == 1 && $t1t_category_big_post_style == 'style_1' ){				
					category_big_post_style1($author_show, $date_show);
				}elseif($page == 1  && $t1t_category_big_post_style == 'style_2' ){
					category_big_post_style2($author_show, $date_show);
				} 
			endwhile;?>
		<?php } ?>

		<div <?php if ( $t1t_category_post_style == 'style_1' ){echo 'class="blog-category"';}elseif( $t1t_category_post_style == 'style_2' ){echo 'class="t1t-blog-posts-category"';}elseif( $t1t_category_post_style == 'style_3' ){echo 'class="img-featured"';}?>>
			<ul>		
			<?php if (have_posts()) : while (have_posts()) : the_post();?>								
				<li>					
				<?php if ( $t1t_category_post_style == 'style_1' ){	
					category_post_style1($author_show, $date_show);	
					}elseif( $t1t_category_post_style == 'style_2' ){
					category_post_style2($author_show, $date_show);
					}elseif( $t1t_category_post_style == 'style_3' ){
					category_post_style3($author_show, $date_show);	
					}?>			
				</li>
				<?php endwhile; else : ?>
					<div class="widget-title"><?php echo 'Sorry, no posts matched your criteria.'; ?></div>
				<?php endif; wp_reset_query();?>
			</ul>
		</div>
	
		<div class="pagination">
			<?php t1t_pagination(); ?>
		</div>
		<!--pagination-->
	</div>
	<!--primary-->
	<div id="secondary">
		<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Category Sidebar')): endif; ?>
	</div>
	<!--secondary-->
	<?php $t1t_popular_widget = get_option('t1t_popular_widget'); if ($t1t_popular_widget == "true") { ?>
	<div id="fullwidth">
		<div class="home-widget four-parts">
			<?php if(get_option('t1t_category_popular_title')) { ?>
			<h3>
				<span class="widget-title">
				<?php echo get_option('t1t_category_popular_title'); ?>
				</span>
			</h3>
			<?php } ?>
			<?php t1t_popular_posts();?>
		</div>
		<!--home-widget four-parts-->
	</div>
	<!--fullwidth-->
	<?php } ?>
</div>
<!--main-->
<?php get_footer(); ?>