PageRenderTime 45ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/archive.php

https://github.com/bchagas/natural
PHP | 35 lines | 21 code | 6 blank | 8 comment | 3 complexity | 7b9efc13de9ba5499649cc679e4c7955 MD5 | raw file
  1. <?php get_header(); ?>
  2. <?php
  3. if ( have_posts() )
  4. the_post();
  5. ?>
  6. <h1>
  7. <?php if ( is_day() ) : ?>
  8. <?php printf( __( 'Daily Archives: <span>%s</span>' ), get_the_date() ); ?>
  9. <?php elseif ( is_month() ) : ?>
  10. <?php printf( __( 'Monthly Archives: <span>%s</span>' ), get_the_date('F Y') ); ?>
  11. <?php elseif ( is_year() ) : ?>
  12. <?php printf( __( 'Yearly Archives: <span>%s</span>' ), get_the_date('Y') ); ?>
  13. <?php else : ?>
  14. <?php _e( 'The Blog' ); ?>
  15. <?php endif; ?>
  16. </h1>
  17. <?php
  18. /* Since we called the_post() above, we need to
  19. * rewind the loop back to the beginning that way
  20. * we can run the loop properly, in full.
  21. */
  22. rewind_posts();
  23. /* Run the loop for the archives page to output the posts.
  24. * If you want to overload this in a child theme then include a file
  25. * called loop-archives.php and that will be used instead.
  26. */
  27. get_template_part( 'loop', 'archive' );
  28. ?>
  29. <?php get_footer(); ?>