<?php get_header(); ?>
<?php if (have_posts()) : ?>

<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. Taken from Kubrick. ?>
<?php /* If this is a category archive */ if (is_category()) { ?>
<h2 class="center">آرشیو "<?php echo single_cat_title(); ?>" (<a href="feed/">RSS</a>)</h2>

<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
<h2 class="center">آرشیو برای <?php the_time('j F Y'); ?></h2>

<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<h2 class="center">آرشیو برای ماه <?php the_time('F Y'); ?></h2>

<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<h2 class="center">آرشیو برای سال <?php the_time('Y'); ?></h2>

<?php /* If this is a search */ } elseif (is_search()) { ?>
<h2 class="center">نتیجه جستجو</h2>

<?php /* If this is an author archive */ } elseif (is_author()) { ?>
<h2 class="center">Author Archives</h2>

<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h2 class="center">Blog Archives</h2>

<?php } ?>

		<div class="navigation">
			<div class="alignleft"><?php next_posts_link('مطالب قبلی') ?></div>
			<div class="alignright"><?php previous_posts_link('مطالب بعدی') ?></div>
		</div>

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

	<h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="لینک ثابت <?php the_title(); ?>"><?php the_title(); ?></a></h2>
	<p class="postinfo"><?php the_time('j F Y'); ?> | <?php the_category(', '); ?> | <?php comments_popup_link('بدون نظر', '1 نظر', '% نظر'); ?>
	<?php edit_post_link('ویرایش', $before = ' | '); ?></p>
	<?php the_content(); ?>

<?php endwhile; ?>
		<div class="navigation">
			<div class="alignleft"><?php next_posts_link('مطالب قبلی') ?></div>
			<div class="alignright"><?php previous_posts_link('مطالب بعدی') ?></div>
		</div>

<?php else: ?>
	<p>Sorry, Nothing found.</p>
<?php endif; ?>

<?php get_footer(); ?>