archive.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /**
  3. * The template for displaying Archive pages.
  4. *
  5. * Learn more: http://codex.wordpress.org/Template_Hierarchy
  6. *
  7. * @package Spun
  8. */
  9. get_header(); ?>
  10. <section id="primary" class="content-area">
  11. <div id="content" class="site-content" role="main">
  12. <?php if ( have_posts() ) : ?>
  13. <header class="page-header">
  14. <h1 class="page-title">
  15. <?php
  16. if ( is_category() ) {
  17. printf( __( 'Category %s', 'spun' ), '<span>' . single_cat_title( '', false ) . '</span>' );
  18. } elseif ( is_tag() ) {
  19. printf( __( 'Tag %s', 'spun' ), '<span>' . single_tag_title( '', false ) . '</span>' );
  20. } elseif ( is_author() ) {
  21. /* Queue the first post, that way we know
  22. * what author we're dealing with (if that is the case).
  23. */
  24. the_post();
  25. printf( __( 'Author %s', 'spun' ), '<span class="vcard"><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></span>' );
  26. /* Since we called the_post() above, we need to
  27. * rewind the loop back to the beginning that way
  28. * we can run the loop properly, in full.
  29. */
  30. rewind_posts();
  31. } elseif ( is_day() ) {
  32. printf( __( 'Day %s', 'spun' ), '<span>' . get_the_date() . '</span>' );
  33. } elseif ( is_month() ) {
  34. printf( __( 'Month %s', 'spun' ), '<span>' . get_the_date( 'F Y' ) . '</span>' );
  35. } elseif ( is_year() ) {
  36. printf( __( 'Year %s', 'spun' ), '<span>' . get_the_date( 'Y' ) . '</span>' );
  37. } elseif ( get_post_format() ) {
  38. printf( __( 'Post Format %s', 'spun' ), '<span>' . get_post_format_string( get_post_format() ) . '</span>' );
  39. } else {
  40. _e( 'Archives', 'spun' );
  41. }
  42. ?>
  43. </h1>
  44. </header><!-- .page-header -->
  45. <?php /* Start the Loop */ ?>
  46. <?php while ( have_posts() ) : the_post(); ?>
  47. <?php
  48. /* Include the Post-Format-specific template for the content.
  49. * If you want to overload this in a child theme then include a file
  50. * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  51. */
  52. get_template_part( 'content', 'home' );
  53. ?>
  54. <?php endwhile; ?>
  55. <?php spun_content_nav( 'nav-below' ); ?>
  56. <?php else : ?>
  57. <?php get_template_part( 'content', 'none' ); ?>
  58. <?php endif; ?>
  59. </div><!-- #content .site-content -->
  60. </section><!-- #primary .content-area -->
  61. <?php get_sidebar(); ?>
  62. <?php get_footer(); ?>