<?php get_header(); ?>

<div id="content">
		<?php if (have_posts()) : ?>

 	  <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>

		<div class="pagetitle">
		<?php
			if ( is_category() ) {
				printf( __( 'Archives for category: <span>%1$s</span>', 'wu-wei' ), single_cat_title( '', FALSE ) );
			} elseif ( is_tag() ) {
				printf( __( 'Archives for posts with tag: <span>%1$s</span>', 'wu-wei' ), single_tag_title( '', FALSE ) );
			} elseif ( is_day() ) {
				printf( __( 'Archives for the day of: <span>%1$s</span>', 'wu-wei' ), get_the_date( get_option( 'date_format' ) ) );
			} elseif ( is_month() ) {
				printf( __( 'Archives for the month of: <span>%1$s</span>', 'wu-wei' ), get_the_date( 'F, Y' ) );
			} elseif ( is_year() ) {
				printf( __( 'Archives for the year of: <span>%1$s</span>', 'wu-wei' ), get_the_date( 'Y' ) );
			} elseif (is_author()) {
				_e( 'Archives <span>For author</span>', 'wu-wei' );
			} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
				_e( 'Blog Archives', 'wu-wei' );
			}
		?>
		</div>

			<div class="navigation">
				<div class="alignleft"><?php next_posts_link( __( '&laquo; Older Entries', 'wu-wei' ) ); ?></div>
				<div class="alignright"><?php previous_posts_link( __( 'Newer Entries &raquo;', 'wu-wei' ) ); ?></div>
				<div class="clearboth"><!-- --></div>
			</div>

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

			<?php get_template_part( 'content', get_post_format() ); ?>

		<?php endwhile; ?>

			<div class="navigation">
				<div class="alignleft"><?php next_posts_link( __( '&laquo; Older Entries', 'wu-wei' ) ); ?></div>
				<div class="alignright"><?php previous_posts_link( __( 'Newer Entries &raquo;', 'wu-wei' ) ); ?></div>
				<div class="clearboth"><!-- --></div>
			</div>

	<?php else :

		if ( is_category() ) { // If this is a category archive
			printf( __( '<h2 class="center">Sorry, but there aren&#8217;t any posts in the %1$s category yet.</h2>', 'wu-wei' ), single_cat_title('',false) );
		} else if ( is_date() ) { // If this is a date archive
			_e( '<h2>Sorry, but there aren&#8217;t any posts with this date.</h2>', 'wu-wei' );
		} else if ( is_author() ) { // If this is a author archive
			printf( __( '<h2 class="center">Sorry, but there aren&#8217;t any posts by %1$s yet.</h2>', 'wu-wei' ), esc_html( get_the_author_meta( 'display_name', get_queried_object_id() ) ) );
		} else {
			_e( '<h2 class="center">No posts found.</h2>', 'wu-wei' );
		}
		get_search_form();

	endif;
?>

</div><!-- #content -->

<?php get_sidebar(); ?>

<?php get_footer(); ?>