archive.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. /**
  3. * The template for displaying Archive pages.
  4. *
  5. * Learn more: http://codex.wordpress.org/Template_Hierarchy
  6. *
  7. * @package Sketch
  8. */
  9. get_header(); ?>
  10. <section id="primary" class="content-area">
  11. <main id="main" class="site-main" role="main">
  12. <?php if ( have_posts() ) : ?>
  13. <header class="page-header">
  14. <h1 class="page-title">
  15. <?php
  16. if ( is_category() ) :
  17. single_cat_title();
  18. elseif ( is_tag() ) :
  19. single_tag_title();
  20. elseif ( is_author() ) :
  21. printf( __( 'Author: %s', 'sketch' ), '<span class="vcard">' . get_the_author() . '</span>' );
  22. elseif ( is_day() ) :
  23. printf( __( 'Day: %s', 'sketch' ), '<span>' . get_the_date() . '</span>' );
  24. elseif ( is_month() ) :
  25. printf( __( 'Month: %s', 'sketch' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'sketch' ) ) . '</span>' );
  26. elseif ( is_year() ) :
  27. printf( __( 'Year: %s', 'sketch' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'sketch' ) ) . '</span>' );
  28. elseif ( is_tax( 'post_format', 'post-format-aside' ) ) :
  29. _e( 'Asides', 'sketch' );
  30. elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) :
  31. _e( 'Galleries', 'sketch');
  32. elseif ( is_tax( 'post_format', 'post-format-image' ) ) :
  33. _e( 'Images', 'sketch');
  34. elseif ( is_tax( 'post_format', 'post-format-video' ) ) :
  35. _e( 'Videos', 'sketch' );
  36. elseif ( is_tax( 'post_format', 'post-format-quote' ) ) :
  37. _e( 'Quotes', 'sketch' );
  38. elseif ( is_tax( 'post_format', 'post-format-link' ) ) :
  39. _e( 'Links', 'sketch' );
  40. elseif ( is_tax( 'post_format', 'post-format-status' ) ) :
  41. _e( 'Statuses', 'sketch' );
  42. elseif ( is_tax( 'post_format', 'post-format-audio' ) ) :
  43. _e( 'Audios', 'sketch' );
  44. elseif ( is_tax( 'post_format', 'post-format-chat' ) ) :
  45. _e( 'Chats', 'sketch' );
  46. else :
  47. _e( 'Archives', 'sketch' );
  48. endif;
  49. ?>
  50. </h1>
  51. <?php
  52. // Show an optional term description.
  53. $term_description = term_description();
  54. if ( ! empty( $term_description ) ) :
  55. printf( '<div class="taxonomy-description">%s</div>', $term_description );
  56. endif;
  57. ?>
  58. </header><!-- .page-header -->
  59. <?php /* Start the Loop */ ?>
  60. <?php while ( have_posts() ) : the_post(); ?>
  61. <?php
  62. /* Include the Post-Format-specific template for the content.
  63. * If you want to override this in a child theme, then include a file
  64. * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  65. */
  66. get_template_part( 'content', get_post_format() );
  67. ?>
  68. <?php endwhile; ?>
  69. <?php sketch_paging_nav(); ?>
  70. <?php else : ?>
  71. <?php get_template_part( 'content', 'none' ); ?>
  72. <?php endif; ?>
  73. </main><!-- #main -->
  74. </section><!-- #primary -->
  75. <?php get_sidebar(); ?>
  76. <?php get_footer(); ?>