<?php get_header(); ?>

<div class="conteudoindex">
<?php if ( have_posts() ) : ?>

<?php
					if ( is_category() ) {
						printf( __( 'Category Archives: %s', 'coffeetime' ), '<h1>' . single_cat_title( '', false ) . '</h1>' );

					} elseif ( is_tag() ) {
						printf( __( 'Tag Archives: %s', 'coffeetime' ), '<h1>' . single_tag_title( '', false ) . '</h1>' );

					} elseif ( is_author() ) {

						the_post();
						printf( __( 'Author Archives: %s', 'coffeetime' ), '<h1><a class="url fn n" href="' . get_author_posts_url( get_the_author_meta( 'ID' ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></h1>' );

						rewind_posts();

					} elseif ( is_day() ) {
						printf( __( 'Daily Archives: %s', 'coffeetime' ), '<h1>' . get_the_date() . '</h1>' );

					} elseif ( is_month() ) {
						printf( __( 'Monthly Archives: %s', 'coffeetime' ), '<h1>' . get_the_date( 'F Y' ) . '</h1>' );

					} elseif ( is_year() ) {
						printf( __( 'Yearly Archives: %s', 'coffeetime' ), '<h1>' . get_the_date( 'Y' ) . '</h1>' );

					} else {
						_e( 'Archives', 'coffeetime' );

					}
				?>

<?php
				if ( is_category() ) {
					$category_description = category_description();
					if ( ! empty( $category_description ) )
						echo apply_filters( 'category_archive_meta', '<span>' . $category_description . '</span>' );

				} elseif ( is_tag() ) {
					$tag_description = tag_description();
					if ( ! empty( $tag_description ) )
						echo apply_filters( 'tag_archive_meta', '<span>' . $tag_description . '</span>' );
				}
			?>
			
<div class="navega">

<?php	if ( is_category() ) {
    $category = get_category( get_query_var('cat') );
    if ( ! empty( $category ) )
        echo '<span class="rss"><a href="' . get_category_feed_link( $category->cat_ID ) . '" title="' . sprintf( __( 'Subscribe to this category', 'coffeetime' ), $category->name ) . '" rel="nofollow">' . __( 'RSS', 'coffeetime' ) . '</a></span>';
} ?> 

<?php posts_nav_link(); ?>
</div>

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

<?php
if ( has_post_thumbnail()) {

get_template_part( 'content', 'cha1' );

} else {

get_template_part( 'content', 'cha2' );

}
?>

 <?php
        endwhile; 
    endif;
    ?>
 
<div class="navega">
<?php posts_nav_link(); ?>
</div>

</div>

<?php get_footer(); ?>