archive.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?php
  2. /**
  3. * The template for displaying Archive pages.
  4. *
  5. * Learn more: http://codex.wordpress.org/Template_Hierarchy
  6. *
  7. * @package Illustratr
  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', 'illustratr' ), '<span class="vcard">' . get_the_author() . '</span>' );
  22. elseif ( is_day() ) :
  23. printf( __( 'Day: %s', 'illustratr' ), '<span>' . get_the_date() . '</span>' );
  24. elseif ( is_month() ) :
  25. printf( __( 'Month: %s', 'illustratr' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'illustratr' ) ) . '</span>' );
  26. elseif ( is_year() ) :
  27. printf( __( 'Year: %s', 'illustratr' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'illustratr' ) ) . '</span>' );
  28. elseif ( is_tax( 'post_format', 'post-format-aside' ) ) :
  29. _e( 'Asides', 'illustratr' );
  30. elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) :
  31. _e( 'Galleries', 'illustratr');
  32. elseif ( is_tax( 'post_format', 'post-format-image' ) ) :
  33. _e( 'Images', 'illustratr');
  34. elseif ( is_tax( 'post_format', 'post-format-video' ) ) :
  35. _e( 'Videos', 'illustratr' );
  36. elseif ( is_tax( 'post_format', 'post-format-quote' ) ) :
  37. _e( 'Quotes', 'illustratr' );
  38. elseif ( is_tax( 'post_format', 'post-format-link' ) ) :
  39. _e( 'Links', 'illustratr' );
  40. elseif ( is_tax( 'post_format', 'post-format-status' ) ) :
  41. _e( 'Statuses', 'illustratr' );
  42. elseif ( is_tax( 'post_format', 'post-format-audio' ) ) :
  43. _e( 'Audios', 'illustratr' );
  44. elseif ( is_tax( 'post_format', 'post-format-chat' ) ) :
  45. _e( 'Chats', 'illustratr' );
  46. elseif ( is_post_type_archive( 'jetpack-portfolio' ) ) :
  47. _e( 'Projects', 'illustratr' );
  48. elseif ( is_tax( 'jetpack-portfolio-type' ) || is_tax( 'jetpack-portfolio-tag' ) ) :
  49. single_term_title();
  50. else :
  51. _e( 'Archives', 'illustratr' );
  52. endif;
  53. ?>
  54. </h1>
  55. <?php
  56. // Show an optional term description.
  57. $term_description = term_description();
  58. if ( ! empty( $term_description ) ) :
  59. printf( '<div class="taxonomy-description">%s</div>', $term_description );
  60. endif;
  61. ?>
  62. </header><!-- .page-header -->
  63. <?php /* Start the Loop */ ?>
  64. <?php while ( have_posts() ) : the_post(); ?>
  65. <?php get_template_part( 'content', get_post_format() ); ?>
  66. <?php endwhile; ?>
  67. <?php illustratr_paging_nav( $post->max_num_pages ); ?>
  68. <?php else : ?>
  69. <?php get_template_part( 'content', 'none' ); ?>
  70. <?php endif; ?>
  71. </main><!-- #main -->
  72. </section><!-- #primary -->
  73. <?php get_sidebar(); ?>
  74. <?php get_footer(); ?>