<?php get_header(); ?>

       <div id="xpress_wrap">
	   
	<?php if(xpress_is_theme_sidebar_disp()) : ?>
	   
		<div id="xpress_content" class="narrowcolumn">
		
	<?php else : ?>
	
		<div id="xpress_content" class="narrowcolumn_nonside">
		
	<?php endif; ?>

    <div id="xpress_header">
    	<div id="xpress_headerimg">
    		<h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
    		<div class="description"><?php bloginfo('description'); ?></div>
    	</div>
    </div>

		<?php if (have_posts()) : ?>

      <?php if(function_exists('is_tag')) : ?>
 	  <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
 	  <?php /* If this is a category archive */ if (is_category()) { ?>
		<p class="xpress_pagetitle"><?php printf(__('Archive for the &#8216;%s&#8217; Category', 'xpress'), single_cat_title('', false)); ?></p>
 	  <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
		<p class="xpress_pagetitle"><?php printf(__('Posts Tagged &#8216;%s&#8217;', 'xpress'), single_tag_title('', false) ); ?></p>
 	  <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
		<p class="xpress_pagetitle"><?php printf(_c('Archive for %s|Daily archive page', 'xpress'), get_the_time(__('F jS, Y', 'xpress'))); ?></p>
 	  <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
		<p class="xpress_pagetitle"><?php printf(_c('Archive for %s|Monthly archive page', 'xpress'), get_the_time(__('F, Y', 'xpress'))); ?></p>
 	  <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
		<p class="xpress_pagetitle"><?php printf(_c('Archive for %s|Yearly archive page', 'xpress'), get_the_time(__('Y', 'xpress'))); ?></p>
	  <?php /* If this is an author archive */ } elseif (is_author()) { ?>
		<p class="xpress_pagetitle"><?php echo get_author_name( get_query_var('author')); _e('Author Archive', 'xpress'); ?></p>
 	  <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
		<p class="xpress_pagetitle"><?php _e('Blog Archives', 'xpress'); ?></p>
 	  <?php } ?>
 	  <?php else : ?>
		 <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php /* If this is a category archive */ if (is_category()) { ?>				
		<p class="xpress_pagetitle">Archive for the '<?php echo single_cat_title(); ?>' Category</p>
		
 	  <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
		<p class="xpress_pagetitle">Archive for <?php the_time('F jS, Y'); ?></p>
		
	 <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
		<p class="xpress_pagetitle">Archive for <?php the_time('F, Y'); ?></p>

		<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
		<p class="xpress_pagetitle">Archive for <?php the_time('Y'); ?></p>
		
	  <?php /* If this is a search */ } elseif (is_search()) { ?>
		<p class="xpress_pagetitle">Search Results</p>
		
	  <?php /* If this is an author archive */ } elseif (is_author()) { ?>
		<p class="xpress_pagetitle">Author Archive</p>

		<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
		<p class="xpress_pagetitle">Blog Archives</p>

		<?php } ?>
	  <?php endif; ?>


		<?php while (have_posts()) : the_post(); ?>
		<div class="post">
				<?php if (function_exists('hotDates')) { hotDates(); }?>
				<h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" <?php if(function_exists('the_title_attribute')) : ?>title="<?php printf(__('Permanent Link to %s', 'xpress'), the_title_attribute('echo=0')); ?>"<?php endif; ?>><?php the_title(); ?></a></h2>
				<small><?php the_time(__('l, F jS, Y', 'xpress')) ?></small>

				<div class="entry">
					<?php the_content() ?>
				</div>

				<p class="postmetadata"><?php if(function_exists('the_tags')) : ?><?php the_tags(__('Tags:', 'xpress'), ', ', '<br />'); ?><?php endif; ?> <?php printf(__('Posted in %s', 'xpress'), get_the_category_list(', ')); ?> | <?php edit_post_link(__('Edit', 'xpress'), '', ' | '); ?>  <?php comments_popup_link(__('No Comments &#187;', 'xpress'), __('1 Comment &#187;', 'xpress'), __('% Comments &#187;', 'xpress'), '', __('Comments Closed', 'xpress') ); ?></p>

			</div>

		<?php endwhile; ?>
		<?php if(function_exists('wp_pagenavi')) : ?>
			<div class="xpress_pagenavi">
				<?php wp_pagenavi(); ?>
			</div>
		<?php else : ?>
			<div class="xpress_navigation">
				<div class="alignleft"><?php next_posts_link(__('&laquo; Older Entries', 'xpress')) ?></div>
				<div class="alignright"><?php previous_posts_link(__('Newer Entries &raquo;', 'xpress')) ?></div>
			</div>
		<?php endif; ?>
	<?php else : ?>

		<p class="center"><?php _e('Not Found', 'xpress'); ?></p>
		<?php include (get_template_directory() . '/searchform.php'); ?>

	<?php endif; ?>

	</div>
       </div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>
