<?php 
/**
 * Trending news archive 
**/ 
?>
<?php get_header(); ?>

<div id="main">
	<div id="primary">
		<div class="archive-name">
			<h1>
				<?php single_month_title(); ?>
			</h1>
		</div><!--archive-name-->
		<div class="archive-posts">
			<ul class="newest-posts-archive">
				<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
				<li>
					<div class="newest-posts-thumb">
						<?php if (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())  ) { ?>
						<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
						<?php the_post_thumbnail('carousel-thumb'); ?>
						</a>
						<?php } ?>
					</div><!--newest-posts-thumb-->
                    <div class="newest-posts-text">
                    <span class="category-sidebar-news"><?php $category = get_the_category(); if($category[0]){echo '<a href="'.get_category_link($category[0]->term_id ).'">'.$category[0]->cat_name.'</a>';} ?></span>
                        <h2><a href="<?php the_permalink() ?>" class="newest-posts-title">
                            <?php the_title(); ?>
                            </a>
                        </h2>
                        <div class="newest-posts-content">
                            <?php echo excerpt(37); ?>
                        </div><!--newest-posts-content-->
                        <div class="newest-posts-date-posted">
                            <span class="bypostauthor">
                            <?php the_author_posts_link(); ?>
                            </span>
                            <span class="date">
                            <?php echo get_the_date(); ?>
                            </span>
                            <span class="views-count">
                                <?php echo get_views(get_the_ID()); ?>
                            </span>
                            <span class="comments-count">
                                <?php comments_number( '0', '1', '%' ); ?>
                            </span>
                        </div><!--newset-posts-date-posted-->
                    </div><!--newest-posts-text-->
				</li>
				<?php endwhile; endif; ?>
			</ul>
		</div><!--archive-posts-->
		<div class="pagination">
			<?php tn_pagination(); ?>
		</div><!--pagination-->
	</div><!--primary-->
	<?php get_sidebar('category'); ?>
</div><!--main-->
<?php get_footer(); ?>
