<?php
/*
Template Name: Archives
*/
?>

<?php /* Counts the posts, comments and categories on your blog */
	$numpostsarray	= wp_count_posts('post');
	$numposts		= $numpostsarray->publish;
	
	$numcommsarray	= wp_count_comments();
	$numcomms		= $numcommsarray->approved;
?>

<?php get_header(); ?>

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
	 <h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
	<div class="meta"><?php the_time('F j, Y'); ?>, <?php the_tags(__('Tags: '), ', ', ','); ?> by <?php the_author() ?>. <?php edit_post_link(__('Edit This')); ?></div>

	<div class="storycontent">
		<?php the_content(__('(more...)')); ?>
		<p><?php printf( __('This is the frontpage of the %1$s blog archives. Currently the archives are spanning %2$s posts and %3$s comments. Through here, you will be able to move down into the archives by way of time or tags. If you are looking for something specific, perhaps you should try the search on the sidebar.'), get_bloginfo('name'), $numposts, $numcomms); ?></p>
		<p><strong>By tags:</strong></p>
		<?php wp_tag_cloud('number=0'); ?>
		<p><strong>By month:</strong></p>
		<ul class="archivepage-list"><?php wp_get_archives('show_post_count=1'); ?></ul>
	</div>

	<div class="feedback">
		<?php wp_link_pages(); ?>
		<?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
	</div>
</div>

<?php comments_template(); // Get wp-comments.php template ?>

<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>

<div id="navlinks">
<div class="alignleft"><?php next_posts_link('« Older Entries', 0); ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries »', '0') ?></div>
</div>
<?php get_footer(); ?>
